-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (34 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
42 lines (34 loc) · 1.24 KB
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
# pull official base image
FROM python:3.12-slim-trixie
# set work directory
WORKDIR /usr/src/app
# set environment varibles
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# install deb packages
# PostgreSQL dependencies are needed for dbshell and backup process
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
gettext \
git \
postgresql-common \
make \
rsync \
&& /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y \
&& apt-get install --assume-yes --no-install-recommends \
postgresql-client-17 libpq5 \
&& apt-get distclean
ARG REQ_FILE=requirements/prod.txt
ARG BUILD_DEPENDENCIES="g++ gcc libc6-dev libpq-dev zlib1g-dev"
# install python dependencies
COPY ./requirements ./requirements
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends ${BUILD_DEPENDENCIES} \
&& python3 -m pip install --no-cache-dir -r ${REQ_FILE} \
&& apt-get purge --assume-yes --auto-remove ${BUILD_DEPENDENCIES} \
&& apt-get distclean
# copy project
COPY . .
RUN python -m django compilemessages --ignore .venv
# ENTRYPOINT is specified only in the local docker-compose.yml to avoid
# accidentally running it in deployed environments.