Spaces:
Running
Running
File size: 797 Bytes
c282634 81e328b c282634 20bc5e4 c282634 56a4099 81e328b c282634 81e328b c282634 20bc5e4 c282634 81e328b 20bc5e4 c282634 | 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 | FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PORT=7860
# Hugging Face Spaces run containers as uid 1000
RUN useradd --create-home --uid 1000 app
WORKDIR /home/app/env
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
COPY --chown=app:app pll_cyber ./pll_cyber
COPY --chown=app:app server ./server
COPY --chown=app:app inference.py openenv.yaml pyproject.toml README.md ./
USER app
EXPOSE 7860
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
CMD python -c "import urllib.request,sys; sys.exit(0 if urllib.request.urlopen('http://localhost:7860/health', timeout=4).status == 200 else 1)"
CMD ["sh", "-c", "uvicorn server.app:app --host 0.0.0.0 --port ${PORT}"]
|