From 72dedb6b0ce5208609e337392b1c722d267e218d Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 10 Oct 2024 14:33:18 +0200 Subject: [PATCH] fix: Build psycopg2 from source, pin python minor version --- Dockerfile | 4 +++- pyproject.toml | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 430fbbb..471fe47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,12 @@ -FROM python:3-slim +FROM python:3.11-slim +# Use 3.11 to avoid django.core.exceptions.ImproperlyConfigured: Error loading psycopg2 or psycopg module MAINTAINER Julian-Samuel Gebühr ENV DOCKER_BUILD=true RUN apt update RUN apt install gettext -y +RUN apt install libpq-dev gcc -y COPY . /app WORKDIR /app RUN mkdir /app/data diff --git a/pyproject.toml b/pyproject.toml index 9ec4434..bb7fde6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ dependencies = [ "markdown", "Pillow", "django-registration", - "psycopg2-binary", + "psycopg2", "django-crispy-forms", "crispy-bootstrap4", "djangorestframework",