From 6348f79b60b3339517c08e426d0a6169ae844b7e Mon Sep 17 00:00:00 2001 From: Floke Date: Fri, 6 Mar 2026 19:55:03 +0000 Subject: [PATCH] fix: [30388f42] Connector Dockerfile - Finaler Uvicorn PATH Fix (Hardened) - Fuegt RUN which uvicorn als Verifizierungs-Schritt nach pip install hinzu. - Aendert den CMD Befehl, um uvicorn mit seinem absoluten Pfad (/usr/local/bin/uvicorn) aufzurufen. - Behebt den uvicorn: command not found Fehler endgueltig. --- connector-superoffice/Dockerfile | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/connector-superoffice/Dockerfile b/connector-superoffice/Dockerfile index 34fd3df6..a6189b5e 100644 --- a/connector-superoffice/Dockerfile +++ b/connector-superoffice/Dockerfile @@ -8,19 +8,21 @@ 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 +# Install dependencies system-wide COPY requirements.txt . -RUN pip install --user --no-cache-dir -r requirements.txt +RUN pip install --no-cache-dir -r requirements.txt +# VERIFICATION STEP: Ensure uvicorn is installed and found +RUN which uvicorn || (echo "ERROR: uvicorn not found after install!" && exit 1) # --- 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 system-wide installed packages from builder +COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages +# Ensure /usr/local/bin (where pip installs executables by default) is in PATH +ENV PATH=/usr/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 . @@ -32,5 +34,5 @@ COPY connector-superoffice/superoffice_client.py . # Expose port for Webhook EXPOSE 8000 -# 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"] +# Start both worker and webhook directly within the CMD, using absolute path for uvicorn +CMD ["/bin/bash", "-c", "python3 worker.py & /usr/local/bin/uvicorn webhook_app:app --host 0.0.0.0 --port 8000"]