File size: 776 Bytes
d0fa882
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9b742cc
79bbf46
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
27
28
# Use the official Python image from the Docker Hub
FROM python:3.9

# Create a new user with UID 1000
RUN useradd -m -u 1000 user

# Switch to the new user
USER user

# Update the PATH environment variable
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory to /app
WORKDIR /app

# Copy the requirements.txt file and change the ownership to the user
COPY --chown=user ./requirements.txt requirements.txt

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

# Copy the rest of the application code and change the ownership to the user
COPY --chown=user . /app

# Set the command to run the application using Uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "8"]