-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (23 loc) · 933 Bytes
/
Dockerfile
File metadata and controls
28 lines (23 loc) · 933 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
FROM python:3.11-slim-bullseye
ENV PYTHONUNBUFFERED 1
ARG DEV_BUILD
WORKDIR /app
VOLUME /data
RUN apt update \
&& apt install -y build-essential gettext gnupg make python3-dev wget \
&& echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& wget --quiet -O /etc/apt/trusted.gpg.d/postgres.asc https://www.postgresql.org/media/keys/ACCC4CF8.asc \
&& apt update \
&& apt install -y postgresql-client-15 libpq-dev \
&& apt upgrade -y \
&& apt purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& apt clean \
&& rm -rf /var/lib/apt/lists/*
RUN addgroup --gid ${GID:-1000} django \
&& adduser --gid ${GID:-1000} --uid ${UID:-1000} --home=/app django \
&& chown -R django:django /app
COPY requirements.txt /app/
RUN pip install --no-cache-dir -U pip \
&& pip install --no-cache-dir -Ur /app/requirements.txt
USER django
COPY . /app/