-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.dev
36 lines (26 loc) · 927 Bytes
/
Dockerfile.dev
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
FROM python:slim
ENV PYTHONUNBUFFERED 1
RUN groupadd -r django && useradd --no-log-init -r -g django django
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpcre3 \
mime-support \
postgresql-client \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --chown=django:django requirements.txt .
RUN BUILD_DEPS=" \
build-essential \
libpcre3-dev \
libpq-dev \
python3-dev \
" \
&& apt-get update && apt-get install -y --no-install-recommends $BUILD_DEPS \
&& pip install --no-cache-dir -r requirements.txt \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*
COPY --chown=django:django . .
RUN mkdir /static && chown -R django:django /static
RUN mkdir /app/media && chown -R django:django /app/media
USER django:django
ENTRYPOINT [ "/app/scripts/docker/entrypoint-dev.sh" ]