File size: 888 Bytes
fe663ca 22ab8da fe663ca 9454c88 fe663ca | 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 | FROM python:3.11-slim
# HF Dev Mode injects an SSH server + VS Code layer that requires git (and a few
# common utilities) to be present in the image. python:*-slim ships without them,
# so install them up front or the Dev Mode build fails at `git config` (exit 127).
RUN apt-get update && apt-get install -y --no-install-recommends \
git curl ca-certificates procps \
&& rm -rf /var/lib/apt/lists/*
# HF Spaces runs as a non-root user (uid 1000) by convention.
RUN useradd -m -u 1000 user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1
WORKDIR /home/user/app
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=user bruno_v1.json .
COPY --chown=user bruno_graph.py .
COPY --chown=user app.py .
USER user
EXPOSE 7860
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|