This commit is contained in:
2025-09-11 09:07:12 +02:00
parent b6abfcfc67
commit f59275deea
6 changed files with 28 additions and 19 deletions

View File

@@ -1,21 +1,21 @@
FROM python:3.11-slim
# Arbeitsverzeichnis
WORKDIR /app
# Git installieren
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Systemabhängigkeiten (optional, falls gebraucht)
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Repository klonen
ARG REPO_URL
RUN git clone ${REPO_URL} /app
# Requirements installieren
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Abhängigkeiten installieren (falls requirements.txt existiert)
RUN pip install --no-cache-dir -r requirements.txt || true
# Code kopieren
COPY . .
# Entrypoint-Skript für git pull beim Start
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV FLASK_APP=app.py
ENV FLASK_ENV=development
EXPOSE 5000
ENTRYPOINT ["/entrypoint.sh"]
CMD ["flask", "run", "--host=0.0.0.0"]