Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim | |
| # Add a non-root user | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| # Copy and install dependencies as that user | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy application code | |
| COPY --chown=user . . | |
| # Prepare a place to unzip your Zarr | |
| RUN mkdir -p /app/unzipped_zarr && chown -R user:user /app/unzipped_zarr | |
| # Enable HF Hub proxy mode | |
| ENV HF_HUB_ENABLE=1 | |
| ENV HF_HUB_ENABLE_PROXY=1 | |
| # Expose the port Hugging Face Spaces expects | |
| EXPOSE 7860 | |
| # Run the FastAPI app under uvicorn | |
| USER user | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] | |