File size: 737 Bytes
1550711 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
FROM python:3.9-slim
# Create user with ID 1000 (required by Hugging Face Spaces)
RUN useradd -m -u 1000 user
# Install required packages
RUN pip install huggingface_hub
# Switch to the user
USER user
# Set environment variables
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH
# Set working directory
WORKDIR $HOME/app
# Copy startup script
COPY --chown=user:user download_and_serve.py .
# Create data directory for downloads
RUN mkdir -p /home/user/app/data
# Expose port 7860 (default for HF Spaces)
EXPOSE 7860
# Environment variable for the raw dataset repository
ENV RAW_DATASET_REPO="davanstrien/flickr-lifeboat-commons-1k-2025-raw"
# Start the download and serve script
CMD ["python", "download_and_serve.py"] |