| 1 | # Use a base image |
| 2 | FROM python:3.9-slim |
| 3 | |
| 4 | # Set working directory |
| 5 | WORKDIR /app |
| 6 | |
| 7 | # Copy requirements file and install dependencies |
| 8 | COPY requirements.txt . |
| 9 | RUN pip install --no-cache-dir -r requirements.txt |
| 10 | |
| 11 | # Copy the rest of the application code |
| 12 | COPY . . |
| 13 | |
| 14 | # Set environment variables |
| 15 | ENV PORT=8080 |
| 16 | |
| 17 | # Start the application |
| 18 | CMD ["python", "app.py"] |