-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (21 loc) · 979 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
FROM python:3.6-slim-stretch
RUN apt-get -y update && apt-get install -y --no-install-recommends \
nginx \
ca-certificates \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Set some environment variables. PYTHONUNBUFFERED keeps Python from buffering our standard
# output stream, which means that logs can be delivered to the user quickly. PYTHONDONTWRITEBYTECODE
# keeps Python from writing the .pyc files which are unnecessary in this case. We also update
# PATH so that the train and serve programs are found when the container is invoked.
ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
ENV PATH="/opt/program:${PATH}"
COPY requirements.txt /opt/program/requirements.txt
WORKDIR /opt/program/src
# Here we get all python packages.
RUN pip install flask gevent gunicorn future
RUN pip install -r ../requirements.txt && rm -rf /root/.cache
COPY src /opt/program/src/
COPY executor.sh /opt/program/executor.sh
ENTRYPOINT ["executor.sh"]