| # Use the official Python image from the Docker Hub | |
| FROM python:3.12-slim | |
| # Set environment variables | |
| ENV PYTHONUNBUFFERED=1 \ | |
| APP_HOME=/app | |
| # Set the working directory | |
| WORKDIR $APP_HOME | |
| # Copy the current directory contents into the container at /app | |
| COPY . . | |
| # Install any needed packages specified in requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose port 8080 to the outside world | |
| EXPOSE 8080 | |
| # Run the application | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"] | |