Files
api7-demo/api/Dockerfile
d.viti 7a4c9eaacc
All checks were successful
Helm Chart Build / lint-only (push) Has been skipped
Helm Chart Build / build-helm (push) Successful in 8s
Build and Deploy / build-api (push) Successful in 39s
Build and Deploy / build-web (push) Successful in 59s
Fix API Dockerfile to use requirements.txt and correct port
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>
2025-10-09 17:29:47 +02:00

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"]