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 <noreply@anthropic.com>
20 lines
370 B
Docker
20 lines
370 B
Docker
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# 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 8080
|
|
|
|
# Run the application
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]
|