-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 835 Bytes
/
Dockerfile
File metadata and controls
34 lines (25 loc) · 835 Bytes
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
FROM python:alpine
ENV LANG=C.UTF-8 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
DJANGO_SETTINGS_MODULE=tracker.settings \
DEBUG=false \
DATA_DIR=/data
COPY requirements.lock /app/
RUN pip install --no-cache-dir -r /app/requirements.lock
COPY . /app
RUN set -x && \
mkdir -p /data && \
python /app/manage.py collectstatic --noinput && \
python -m compileall -f -q /app && \
find /app -type d -print0 | xargs -0 chmod 555 && \
find /app -type f -print0 | xargs -0 chmod 444 && \
chmod 555 /app/manage.py /app/docker-entrypoint.sh && \
chown -R nobody:0 /app /data && \
chmod g+s /app /data
WORKDIR /app
USER nobody
VOLUME ["/data"]
EXPOSE 8000
ENTRYPOINT ["/app/docker-entrypoint.sh"]
CMD ["gunicorn", "-c", "gunicorn.conf.py", "--access-logfile", "-", "tracker.wsgi"]