-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
44 lines (30 loc) · 945 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
41
42
43
44
FROM python:3.7-slim
LABEL maintainer="[email protected]"
CMD ["bin/entrypoint.sh"]
EXPOSE 8000
HEALTHCHECK --interval=5m --timeout=15s --start-period=30s \
CMD curl --fail http://127.0.0.1:8000/admin/ || exit 1
ENV APP_ROOT=/opt/app \
APP_USER=django \
LOG_LEVEL=info \
CELERY_LOG_LEVEL=INFO \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR $APP_ROOT
RUN useradd -d $APP_ROOT -r $APP_USER
RUN apt-get update && \
apt-get install --no-install-recommends -y \
postgresql-client \
libpq-dev \
&& \
apt-get clean
RUN pip install --no-cache-dir --upgrade pip
ADD requirements.txt $APP_ROOT
RUN apt-get install --no-install-recommends -y build-essential && \
pip install --no-cache-dir -r requirements.txt && \
apt-get remove -y build-essential && \
apt-get clean && \
apt-get autoremove -y
ADD . $APP_ROOT
RUN python3 manage.py collectstatic --no-input
USER $APP_USER