perf: [30388f42] Docker-Optimierung (Lead-Engine, Heatmap, Transcription)
- Konvertiert lead-engine/Dockerfile zu Multi-Stage Build mit requirements.txt. - Aktualisiert heatmap-tool und transcription-tool auf Python 3.11-slim. - Entfernt unnötige Build-Tools (build-essential) aus den Runtime-Images. - Deaktiviert --reload Modus für Produktionsstabilität.
This commit is contained in:
@@ -1,15 +1,31 @@
|
||||
FROM python:3.9-slim
|
||||
|
||||
# --- STAGE 1: Builder ---
|
||||
FROM python:3.11-slim AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
# Install build dependencies
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install dependencies required for ingestion and DB
|
||||
RUN pip install streamlit pandas requests python-dotenv fastapi "uvicorn[standard]" msal
|
||||
# Install python dependencies
|
||||
COPY requirements.txt .
|
||||
RUN pip install --user --no-cache-dir -r requirements.txt
|
||||
|
||||
# --- STAGE 2: Runtime ---
|
||||
FROM python:3.11-slim
|
||||
WORKDIR /app
|
||||
|
||||
# Copy installed packages
|
||||
COPY --from=builder /root/.local /root/.local
|
||||
ENV PATH=/root/.local/bin:$PATH
|
||||
|
||||
# Copy app code
|
||||
COPY . .
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
EXPOSE 8501
|
||||
EXPOSE 8004
|
||||
|
||||
# Start monitor in background and streamlit in foreground
|
||||
CMD ["sh", "-c", "python monitor.py & streamlit run app.py --server.port=8501 --server.address=0.0.0.0"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user