Files
Brancheneinstufung2/connector-superoffice/Dockerfile
Floke 8e20adae93 fix: [30388f42] Connector: CMD Fix (uvicorn & Worker)
- Integriert den Start von  (Hintergrund) und  (Vordergrund) direkt in den  Befehl des Dockerfiles.
- Eliminiert die  Fehler.
- Entfernt das überflüssige  Skript.
2026-03-06 19:02:35 +00:00

41 lines
1.2 KiB
Docker

# --- STAGE 1: Builder ---
FROM python:3.11-slim AS builder
WORKDIR /app
# Install system dependencies needed for building C-extensions
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
&& 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: Final Runtime ---
FROM python:3.11-slim
WORKDIR /app
# Copy only the installed packages from builder
COPY --from=builder /root/.local /root/.local
# Update PATH to include the user-installed packages
ENV PATH=/root/.local/bin:$PATH
# Copy source code explicitly from their locations relative to the build context (which will be the project root)
COPY connector-superoffice/worker.py .
COPY connector-superoffice/webhook_app.py .
COPY connector-superoffice/queue_manager.py .
COPY connector-superoffice/config.py .
COPY connector-superoffice/superoffice_client.py .
COPY connector-superoffice/start.sh .
# Expose port for Webhook
EXPOSE 8000
# Make sure scripts are executable
RUN chmod +x start.sh
# Start both worker and webhook directly within the CMD
CMD ["/bin/bash", "-c", "python3 worker.py & uvicorn webhook_app:app --host 0.0.0.0 --port 8000"]