| FROM python:3.11-slim | |
| WORKDIR /code | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Create necessary directories with permissions | |
| RUN mkdir -p /.cache bluesky_data | |
| RUN chmod 777 /.cache bluesky_data | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY . . | |
| # Expose the port | |
| EXPOSE 7860 | |
| # Set environment variables (these should be overridden at runtime) | |
| ENV HF_REPO_ID="davanstrien/bluesky-counts" | |
| ENV HF_REPO_TYPE="dataset" | |
| ENV HF_TOKEN="" | |
| CMD ["python", "app.py"] | |