File size: 552 Bytes
b6167fa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use lightweight Python
FROM python:3.10-slim

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

WORKDIR $HOME/app

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

# Copy all your python files
COPY --chown=user . .

# Create the debug directory (required by your utils)
RUN mkdir -p debug_artifacts

# Expose port
EXPOSE 7860

# Start the API
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]