2026-11-01 00:20:50 +00:00
|
|
|
# 1. Das normale, vollständige Python-Image nutzen
|
|
|
|
|
FROM python:3.8.18
|
2026-05-21 10:15:48 +00:00
|
|
|
|
|
|
|
|
# 2. Setze Umgebungsvariablen für Python
|
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1
|
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
|
|
|
|
|
|
|
|
# 3. Setze das Arbeitsverzeichnis im Container
|
|
|
|
|
WORKDIR /code
|
|
|
|
|
|
|
|
|
|
# 4. Installiere System-Abhängigkeiten
|
2026-11-01 00:20:50 +00:00
|
|
|
# 'gcc' wird hier nicht mehr benötigt, da es im Image schon enthalten ist
|
2026-05-21 10:15:48 +00:00
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
libpq-dev \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
|
|
# 5. Installiere die Python-Abhängigkeiten
|
|
|
|
|
COPY requirements.txt /code/
|
|
|
|
|
RUN pip install --upgrade pip && pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
# 6. Kopiere den restlichen Django-Quellcode in den Container
|
|
|
|
|
COPY . /code/
|
|
|
|
|
|
2026-11-01 00:20:50 +00:00
|
|
|
# 7. Erstelle die Ordner für statische Medien
|
2026-05-21 10:15:48 +00:00
|
|
|
RUN mkdir -p /code/staticfiles /code/mediafiles
|