-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev.Dockerfile
42 lines (31 loc) · 845 Bytes
/
dev.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
ARG PYTHON_VERSION=3.13.2
ARG UID=1000
ARG GID=1000
ARG APP_DIR=/home/app
FROM python:${PYTHON_VERSION}-slim-bookworm AS base
ARG UID
ARG GID
ARG APP_DIR
RUN apt-get update && \
apt-get install -y --no-install-recommends \
gcc \
libpq-dev \
build-essential \
git && \
rm -rf /var/lib/apt/lists/*
RUN pip install --upgrade pip
RUN groupadd -g ${GID} app \
&& useradd -m -u ${UID} -g app app \
&& mkdir -p ${APP_DIR} \
&& chown -R app:app ${APP_DIR}
WORKDIR ${APP_DIR}
FROM base AS dev
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
ENV DEBUG=1
COPY --chown=app:app ./requirements.txt .
RUN pip install -r requirements.txt
COPY --chown=app:app . .
RUN mkdir -p ${APP_DIR}/staticfiles ${APP_DIR}/mediafiles \
&& chown -R app:app ${APP_DIR}/staticfiles ${APP_DIR}/mediafiles
USER app