Spaces:
Sleeping

File size: 698 Bytes
5ccc161
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.11-slim

# --- Dev Mode requirements ---
# bash (SSH), curl/wget/procps (VS Code server), git + git-lfs (push from inside the Space)
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
      bash git git-lfs wget curl procps && \
    rm -rf /var/lib/apt/lists/*

# non-root user with uid 1000, app code in /app, CMD for startup
RUN useradd -m -u 1000 user
WORKDIR /app

COPY --chown=user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

COPY --chown=user . /app

USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONUNBUFFERED=1

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]