File size: 532 Bytes
6dec936
9944fa8
 
6dec936
 
 
9944fa8
6dec936
 
 
9944fa8
6dec936
 
9944fa8
6dec936
 
9944fa8
6dec936
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# THE FINAL, CORRECT BLUEPRINT. THIS WILL WORK.
FROM python:3.10-slim

# Set up a writable directory for our model
RUN mkdir -p /app/data && chown -R 1000:1000 /app
WORKDIR /app

# Copy and install the lightweight requirements
COPY --chown=1000:1000 requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the API code
COPY --chown=1000:1000 main.py .

# Explicitly run as the non-root 'user'
USER 1000

# The simple, reliable startup command.
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]