Spaces:
Sleeping
Sleeping
File size: 1,134 Bytes
14fdc5e 74e26fb 14fdc5e | 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 33 34 35 | # Hugging Face Space (Docker SDK) — backend only.
# The frontend runs separately on Netlify (or Vercel). Netlify only needs
# BACKEND_URL pointing at this Space's public URL.
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
HF_HOME=/home/user/.cache/huggingface
# HF Spaces runs containers as UID 1000. Create that user up-front so writes to
# uploads/data/logs work without root.
RUN useradd --create-home --uid 1000 user
WORKDIR /home/user/app
COPY --chown=user:user backend/requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=user:user backend ./backend
# Pre-create the writable directories the app expects. On the free Space tier
# these are ephemeral (wiped on rebuild/sleep) — point S3_* at Supabase Storage
# in your Space secrets to persist resume PDFs across restarts.
RUN mkdir -p backend/data/uploads backend/data/reference_resumes logs && \
chown -R user:user backend/data logs
USER user
WORKDIR /home/user/app/backend
EXPOSE 7860
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|