Spaces:
Sleeping
Sleeping
| # Annator full stack — Hugging Face Docker Space | |
| # Frontend (AIMONEYFLOW + clients) + ATOM FastAPI backend | |
| # Public port: 7860 | |
| FROM python:3.11-slim-bookworm | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| PORT=7860 \ | |
| HOST=0.0.0.0 \ | |
| ENVIRONMENT=development \ | |
| ALLOWED_HOSTS=* \ | |
| ALLOWED_ORIGINS=* \ | |
| SKIP_USER_BOOTSTRAP=true \ | |
| HF_SPACE=1 \ | |
| DATABASE_URL=sqlite:////app/data/atom.db | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libpq-dev \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # HF Spaces convention: uid 1000 | |
| RUN useradd -m -u 1000 user || true | |
| WORKDIR /app | |
| COPY --chown=user:user requirements.txt /app/requirements.txt | |
| RUN pip install --upgrade pip \ | |
| && pip install --no-cache-dir -r /app/requirements.txt | |
| COPY --chown=user:user backend /app/backend | |
| COPY --chown=user:user frontend /app/frontend | |
| COPY --chown=user:user serve.py /app/serve.py | |
| RUN mkdir -p /app/data && chown -R user:user /app | |
| USER user | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \ | |
| CMD curl -fsS http://127.0.0.1:7860/api/hf/status || exit 1 | |
| CMD ["python", "-m", "uvicorn", "serve:app", "--host", "0.0.0.0", "--port", "7860"] | |