Skip to content

Commit e56641b

Browse files
committed
Use the binary version of psycopg
1 parent 1768ba5 commit e56641b

File tree

5 files changed

+7
-13
lines changed

5 files changed

+7
-13
lines changed

Dockerfile

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ ENV PYTHONDONTWRITEBYTECODE=1
99
ENV PYTHONUNBUFFERED=1
1010

1111
# install deb packages
12+
# PostgreSQL dependencies are needed for dbshell and backup process
1213
RUN apt-get update \
1314
&& apt-get install --assume-yes --no-install-recommends \
1415
gettext \
@@ -23,23 +24,14 @@ RUN apt-get update \
2324
&& apt-get distclean
2425

2526
ARG REQ_FILE=requirements/prod.txt
27+
ARG BUILD_DEPENDENCIES="g++ gcc libc6-dev libpq-dev zlib1g-dev"
2628

2729
# install python dependencies
2830
COPY ./requirements ./requirements
2931
RUN apt-get update \
30-
&& apt-get install --assume-yes --no-install-recommends \
31-
g++ \
32-
gcc \
33-
libc6-dev \
34-
libpq-dev \
35-
zlib1g-dev \
32+
&& apt-get install --assume-yes --no-install-recommends ${BUILD_DEPENDENCIES} \
3633
&& python3 -m pip install --no-cache-dir -r ${REQ_FILE} \
37-
&& apt-get purge --assume-yes --auto-remove \
38-
g++ \
39-
gcc \
40-
libc6-dev \
41-
libpq-dev \
42-
zlib1g-dev \
34+
&& apt-get purge --assume-yes --auto-remove ${BUILD_DEPENDENCIES} \
4335
&& apt-get distclean
4436

4537
# copy project

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ services:
55
dockerfile: Dockerfile
66
args:
77
- REQ_FILE=requirements/tests.txt
8+
- BUILD_DEPENDENCIES=g++ gcc
89
entrypoint: ./docker-entrypoint.dev.sh
910
command: python manage.py runserver 0.0.0.0:8000
1011
volumes:

requirements/common.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Jinja2==3.1.6
1414
libsass==0.23.0
1515
Markdown==3.9
1616
Pillow==11.3.0
17-
psycopg[c]==3.2.9
1817
Pygments==2.19.2
1918
pykismet3==0.1.1
2019
requests==2.32.5

requirements/dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-r common.txt
22
django-debug-toolbar==6.0.0
33
pre-commit~=4.3.0
4+
psycopg[binary]==3.2.10
45
watchdog==6.0.0

requirements/prod.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-r common.txt
22
gunicorn==23.0.0
3+
psycopg[c]==3.2.10
34
redis==6.4.0
45
sentry-sdk==2.38.0

0 commit comments

Comments
 (0)