multiple corrections on docker-compose and Dockerfile
robust start sequence avoid scrolling of main content
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
# Datei: server/Dockerfile.dev
|
||||
# Entwicklungs-Dockerfile für die API (Flask + SQLAlchemy)
|
||||
# 🔧 OPTIMIERT: Für die Entwicklung im Dev-Container
|
||||
# ==========================================
|
||||
|
||||
FROM python:3.13-slim
|
||||
|
||||
# Build args für UID/GID
|
||||
# Die Erstellung des non-root Users und die Locale-Konfiguration
|
||||
# sind für den Dev-Container nicht zwingend nötig, da VS Code sich als 'root'
|
||||
# verbindet (gemäß devcontainer.json). Sie schaden aber nicht.
|
||||
ARG USER_ID=1000
|
||||
ARG GROUP_ID=1000
|
||||
|
||||
# Erstelle non-root User
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends locales curl \
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends locales curl git \
|
||||
&& groupadd -g ${GROUP_ID} infoscreen_taa \
|
||||
&& useradd -u ${USER_ID} -g ${GROUP_ID} --shell /bin/bash --create-home infoscreen_taa \
|
||||
&& sed -i 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen \
|
||||
@@ -17,32 +17,26 @@ RUN apt-get update \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV LANG=de_DE.UTF-8 \
|
||||
LANGUAGE=de_DE:de \
|
||||
LC_ALL=de_DE.UTF-8
|
||||
|
||||
# Arbeitsverzeichnis
|
||||
WORKDIR /app
|
||||
# Setze das Arbeitsverzeichnis auf den Workspace-Root, passend zu den Mounts.
|
||||
WORKDIR /workspace
|
||||
|
||||
# Kopiere nur Requirements für schnellen Rebuild
|
||||
COPY requirements.txt ./
|
||||
COPY requirements-dev.txt ./
|
||||
# Kopiere die Anforderungsdateien in das korrekte Unterverzeichnis.
|
||||
# ✅ KORRIGIERT: Pfade sind jetzt relativ zum Build-Kontext (dem 'server'-Verzeichnis)
|
||||
COPY requirements.txt requirements-dev.txt ./
|
||||
|
||||
# Installiere Python-Abhängigkeiten (Prod + Dev)
|
||||
# Installiere die Python-Abhängigkeiten
|
||||
RUN pip install --upgrade pip \
|
||||
&& pip install --no-cache-dir -r requirements.txt \
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt
|
||||
&& pip install --no-cache-dir -r requirements-dev.txt
|
||||
|
||||
# Expose Ports für Flask API
|
||||
EXPOSE 8000
|
||||
EXPOSE 5678
|
||||
# Das Kopieren des Codes ist nicht nötig, da das Verzeichnis gemountet wird.
|
||||
|
||||
# Setze Env für Dev
|
||||
ENV FLASK_ENV=development
|
||||
ENV ENV_FILE=.env
|
||||
# Exponiere die Ports für die Flask API und den Debugger
|
||||
EXPOSE 8000 5678
|
||||
|
||||
# Wechsle zum non-root User
|
||||
USER infoscreen_taa
|
||||
# Der Startbefehl wird in der docker-compose.override.yml definiert.
|
||||
# Ein Standard-CMD dient als Fallback.
|
||||
CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "-m", "flask", "run", "--host=0.0.0.0", "--port=8000"]
|
||||
|
||||
# Default Command: Flask Development Server
|
||||
CMD ["python", "-m", "debugpy", "--listen", "0.0.0.0:5678", "wsgi.py"]
|
||||
# CMD ["sleep", "infinity"]
|
||||
|
||||
Reference in New Issue
Block a user