File size: 449 Bytes
029ab19
 
586c48c
 
 
 
ed87eb4
586c48c
 
 
 
029ab19
f8ff2a0
029ab19
0306ba4
029ab19
586c48c
 
029ab19
586c48c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 1. Use extremely lightweight Python
FROM python:3.9-slim

# 2. Set working directory
WORKDIR /app

# 3. Create user
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# 4. Copy requirements & Install
COPY --chown=user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# 5. Copy App Code
COPY --chown=user . .

# 6. Start Server
CMD ["uvicorn", "api.index:app", "--host", "0.0.0.0", "--port", "7860"]