long-view / Dockerfile
arjun10g's picture
Long View loader
b54e544
Raw History Blame Contribute Delete
853 Bytes
FROM python:3.12-slim
WORKDIR /app
RUN pip install --no-cache-dir uv huggingface_hub
# Fetch the pinned application source from the private dataset with the Space's HF_TOKEN build secret.
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
python -c "from huggingface_hub import snapshot_download; snapshot_download('arjun10g/long-view-data', repo_type='dataset', revision='311995c96959422649c86a1024e67af82a8021c8', allow_patterns=['app_code/*'], local_dir='/tmp/code', token=open('/run/secrets/HF_TOKEN').read().strip())" \
&& cp -a /tmp/code/app_code/. /app/ && rm -rf /tmp/code
RUN uv sync --frozen --no-dev
ENV PATH="/app/.venv/bin:$PATH" APP_ENV=space HF_ENABLED=true HOST=0.0.0.0 PORT=7860 LONG_TERM_DATA_DIR=/data LONG_TERM_REPORT_DIR=/data/reports
EXPOSE 7860
CMD ["long-term", "serve", "--host", "0.0.0.0", "--port", "7860"]