-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (27 loc) · 855 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
30
31
32
33
34
35
36
37
38
FROM python:3.6.8-stretch
ENV PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=0.12.16
RUN pip install "poetry==$POETRY_VERSION"
WORKDIR /var/app
# Copy only requirements to cache them in docker layer
COPY poetry.lock pyproject.toml /var/app/
RUN poetry config settings.virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Gunicorn
RUN pip install gunicorn setproctitle
COPY ./scripts/gunicorn_start.sh /var/app/gunicorn_start.sh
RUN chmod u+x /var/app/gunicorn_start.sh
# Copy the app's files
COPY . /var/app
# Add app to Python path
ENV PYTHONPATH="${PYTHONPATH}:/var/app"
# Create log directories
RUN mkdir -p /var/app/logs
# Open port
EXPOSE 80
ENTRYPOINT ["/var/app/gunicorn_start.sh"]