-
-
Notifications
You must be signed in to change notification settings - Fork 965
/
Dockerfile
47 lines (40 loc) · 1.1 KB
/
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
45
46
47
# pull official base image
FROM python:3.12-slim-bookworm
# set work directory
WORKDIR /usr/src/app
# set environment varibles
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# install deb packages
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
gettext \
git \
libpq5 \
make \
netcat-openbsd \
postgresql-client-15 \
rsync \
zlib1g \
&& rm -rf /var/lib/apt/lists/*
ARG REQ_FILE=requirements/prod.txt
# install python dependencies
COPY ./requirements ./requirements
RUN apt-get update \
&& apt-get install --assume-yes --no-install-recommends \
g++ \
gcc \
libc6-dev \
libpq-dev \
zlib1g-dev \
&& python3 -m pip install --no-cache-dir -r ${REQ_FILE} \
&& apt-get purge --assume-yes --auto-remove \
gcc \
libc6-dev \
libpq-dev \
zlib1g-dev \
&& rm -rf /var/lib/apt/lists/*
# copy project
COPY . .
# ENTRYPOINT is specified only in the local docker-compose.yml to avoid
# accidentally running it in deployed environments.