File size: 598 Bytes
726a1c2
 
3a17674
726a1c2
 
 
 
 
3a17674
726a1c2
 
3a17674
726a1c2
 
0c4794f
726a1c2
3a17674
 
726a1c2
3a17674
 
6418d7a
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use an official Python runtime as a parent image
FROM python:3.10-slim

# Set up a new user 'user' with UID 1000
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory to /home/user/app
WORKDIR $HOME/app

# Copy the current directory contents into the container at /home/user/app
COPY --chown=user . .

# Install dependencies
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Expose port 7860
EXPOSE 7860

# Start the application using uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]