crodri/vfrplan-agent
0
1# vfrplan agent — Docker Space.2#3# Replaces the earlier Gradio SDK version of this same Space. Switching SDK is4# a README.md metadata change (sdk: gradio -> sdk: docker) plus this file; see5# DEPLOY.md §1 before the first push, because leaving the old metadata in place6# makes the Space ignore this Dockerfile entirely.7 8FROM python:3.12-slim9 10# git/git-lfs/curl/wget/procps are not used by the app. They are what Hugging11# Face's Dev Mode layer needs (VS Code in the browser + SSH); without them a12# Space with Dev Mode enabled fails to build with a bare "git: not found",13# which is exactly how the vfrplan-mcp Space failed on its first deploy.14RUN apt-get update && apt-get install -y --no-install-recommends \15 git git-lfs curl wget procps \16 && rm -rf /var/lib/apt/lists/*17 18# uid 1000 and /app: both are Hugging Face conventions. Dev Mode expects the19# application to live in /app owned by uid 1000 so it can edit files in the20# running container.21RUN useradd --create-home --uid 1000 user22USER user23ENV HOME=/home/user \24 PATH=/home/user/.local/bin:$PATH \25 PYTHONUNBUFFERED=1 \26 PYTHONDONTWRITEBYTECODE=127WORKDIR $HOME/app28 29COPY --chown=user requirements.txt ./30RUN pip install --no-cache-dir --upgrade pip \31 && pip install --no-cache-dir -r requirements.txt32 33COPY --chown=user PROMPT.md ./34COPY --chown=user app ./app35 36# 7860 is the Spaces default and matches app_port in README.md. Change one and37# you must change the other.38EXPOSE 786039 40HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \41 CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:7860/health', timeout=4).status==200 else 1)"42 43# Single worker on purpose: the runtime config (endpoint, model, token set44# through the settings panel) lives in this process's memory, so a second45# worker would answer some requests with stale settings.46CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]47 