From 7a4c9eaacc80b5ece639cb414f1f3d81a35023e0 Mon Sep 17 00:00:00 2001 From: "d.viti" Date: Thu, 9 Oct 2025 17:29:47 +0200 Subject: [PATCH] Fix API Dockerfile to use requirements.txt and correct port MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed Dockerfile to properly install all dependencies from requirements.txt instead of hardcoding them, and corrected the port from 8001 to 8080. Issues Fixed: 1. ModuleNotFoundError: No module named 'httpx' - Dockerfile was hardcoding pip install - httpx was missing from hardcoded dependencies 2. Port mismatch - Dockerfile was exposing port 8001 - Application uses port 8080 Changes: - Copy requirements.txt before installing - Use pip install -r requirements.txt - Changed EXPOSE from 8001 to 8080 - Changed CMD port from 8001 to 8080 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- api/Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/Dockerfile b/api/Dockerfile index 39bb407..57c6a45 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -2,15 +2,18 @@ FROM python:3.11-slim WORKDIR /app -# Install dependencies -RUN pip install --no-cache-dir fastapi uvicorn[standard] pydantic +# Copy requirements first for better caching +COPY requirements.txt . + +# Install dependencies from requirements.txt +RUN pip install --no-cache-dir -r requirements.txt # Copy application COPY db.json . COPY main.py . # Expose port -EXPOSE 8001 +EXPOSE 8080 # Run the application -CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001"] +CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]