# sync_pilot — Median Müzik · sync-licensing dashboard. # Deployed to HuggingFace Spaces (Docker SDK). # # The deploy script (sync_pilot/scripts/deploy-hf.sh) copies the # ``sync_pilot/`` Python package alongside this Dockerfile so that # ``import sync_pilot.dashboard.app`` resolves from ``/app/sync_pilot``. FROM python:3.12-slim RUN apt-get update && apt-get install -y --no-install-recommends \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app # Install Python deps first so the layer caches across code changes. COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy the wrapper app + the sync_pilot package source. COPY . . EXPOSE 8501 ENV PYTHONUNBUFFERED=1 ENV STREAMLIT_SERVER_PORT=8501 ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 ENV STREAMLIT_SERVER_HEADLESS=true ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false ENV HF_SPACE=1 # Default routes data_loader to the private HF dataset; the Space's # PRIVATE_DATASET_REPO + HF_TOKEN secrets pick the actual repo. ENV SYNC_PILOT_DATA_SOURCE=hf # huggingface_hub snapshot cache lands here (mounted ephemeral on Spaces); # data_loader resolves the snapshot directory under config.HF_CACHE_DIR. ENV HF_HOME=/tmp/hf-cache HEALTHCHECK --interval=30s --timeout=10s --start-period=10s --retries=3 \ CMD curl -f http://localhost:8501/_stcore/health || exit 1 CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]