Spaces:
Runtime error
Runtime error
| # Use official Python runtime as base image | |
| FROM python:3.9-slim | |
| # Set working directory in container | |
| WORKDIR /app | |
| # Install git (required by GitPython for cloning repositories) | |
| RUN apt-get update && \ | |
| apt-get install -y git && \ | |
| apt-get clean && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Copy requirements file | |
| COPY requirements.txt . | |
| # Install Python dependencies | |
| # Using trusted-host to handle SSL certificate issues in build environment | |
| RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Set environment variables | |
| ENV FLASK_ENV=production | |
| ENV PYTHONUNBUFFERED=1 | |
| ENV PORT=5001 | |
| # Expose port 5001 | |
| EXPOSE 5001 | |
| # Run the application | |
| CMD ["python", "server.py"] | |