diff --git a/heatmap-tool/backend/Dockerfile b/heatmap-tool/backend/Dockerfile index 23677cdc..2ff8bdc2 100644 --- a/heatmap-tool/backend/Dockerfile +++ b/heatmap-tool/backend/Dockerfile @@ -1,19 +1,19 @@ # --- STAGE 1: Builder --- -FROM python:3.9-slim AS builder +FROM python:3.11-slim AS builder WORKDIR /app # Install system dependencies needed for building RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ - && rm -rf /var/lib/apt/lists/* + && apt-get clean && rm -rf /var/lib/apt/lists/* # Install dependencies into a local directory COPY requirements.txt . RUN pip install --user --no-cache-dir -r requirements.txt # --- STAGE 2: Runtime --- -FROM python:3.9-slim +FROM python:3.11-slim WORKDIR /app diff --git a/lead-engine/Dockerfile b/lead-engine/Dockerfile index 91e0d9ad..03c58d92 100644 --- a/lead-engine/Dockerfile +++ b/lead-engine/Dockerfile @@ -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"] diff --git a/lead-engine/requirements.txt b/lead-engine/requirements.txt new file mode 100644 index 00000000..50608512 --- /dev/null +++ b/lead-engine/requirements.txt @@ -0,0 +1,7 @@ +streamlit +pandas +requests +python-dotenv +fastapi +uvicorn[standard] +msal \ No newline at end of file diff --git a/transcription-tool/Dockerfile b/transcription-tool/Dockerfile index 0717edcb..2bdc7993 100644 --- a/transcription-tool/Dockerfile +++ b/transcription-tool/Dockerfile @@ -6,19 +6,25 @@ RUN npm install COPY frontend/ ./ RUN npm run build -# --- STAGE 2: Backend & Runtime --- +# --- STAGE 2: Backend Builder --- +FROM python:3.11-slim AS backend-builder +WORKDIR /app +RUN apt-get update && apt-get install -y --no-install-recommends build-essential && rm -rf /var/lib/apt/lists/* +COPY backend/requirements.txt . +RUN pip install --user --no-cache-dir -r requirements.txt + +# --- STAGE 3: Final Runtime --- FROM python:3.11-slim WORKDIR /app # System Dependencies (FFmpeg ist essenziell) -RUN apt-get update && apt-get install -y \ +RUN apt-get update && apt-get install -y --no-install-recommends \ ffmpeg \ - build-essential \ - && rm -rf /var/lib/apt/lists/* + && apt-get clean && rm -rf /var/lib/apt/lists/* -# Copy Requirements & Install -COPY backend/requirements.txt . -RUN pip install --no-cache-dir -r requirements.txt +# Copy Installed Packages +COPY --from=backend-builder /root/.local /root/.local +ENV PATH=/root/.local/bin:$PATH # Copy Built Frontend from Stage 1 COPY --from=frontend-builder /build/dist /frontend_static @@ -34,4 +40,4 @@ ENV PYTHONUNBUFFERED=1 EXPOSE 8001 # Start FastAPI -CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "8001", "--reload"] \ No newline at end of file +CMD ["uvicorn", "backend.app:app", "--host", "0.0.0.0", "--port", "8001"] \ No newline at end of file