forked from torchbox/wagtail-torchbox
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
40 lines (29 loc) · 929 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
39
40
# Build Python app.
FROM python:3.6-stretch
WORKDIR /app
ENV PYTHONUNBUFFERED=1 \
PYTHONPATH=/app \
DJANGO_SETTINGS_MODULE=tbx.settings.production \
PORT=8000 \
WEB_CONCURRENCY=3 \
GUNICORN_CMD_ARGS="--max-requests 1200 --access-logfile -"
EXPOSE 8000
# Install operating system dependencies.
RUN apt-get update -y && \
rm -rf /var/lib/apt/lists/*
# Install Gunicorn.
RUN pip install "gunicorn>=19.8,<19.9"
# Install Python requirements.
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
# Don't use the root user as it's an anti-pattern and Heroku does not run
# containers as root either.
# https://devcenter.heroku.com/articles/container-registry-and-runtime#dockerfile-commands-and-runtime
#RUN useradd tbx
#RUN chown -R tbx .
#USER tbx
# Install assets
RUN SECRET_KEY=none django-admin collectstatic --noinput --clear
# Run application
CMD gunicorn tbx.wsgi:application