| # Base image with Python | |
| FROM python:3.9-slim | |
| # Set working directory | |
| WORKDIR /app | |
| # Copy everything into the container | |
| COPY . /app | |
| # Set Hugging Face cache location | |
| ENV HF_HOME=/app/cache | |
| # Create cache directory with safe permissions | |
| RUN mkdir -p /app/cache && chmod -R 777 /app/cache | |
| # Install any needed packages specified in requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Expose port 7860 (default port for Flask app) | |
| EXPOSE 7860 | |
| # Run app.py when the container launches | |
| CMD ["python", "server.py"] |