File size: 853 Bytes
e448132
 
73e3c61
e448132
73e3c61
e448132
 
73e3c61
e448132
 
73e3c61
 
e448132
73e3c61
 
e448132
73e3c61
e448132
 
73e3c61
 
e448132
73e3c61
e448132
 
 
 
 
 
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
29
# Use an official Python runtime as a parent image
FROM python:3.9.13

# Create a new user with a specific UID and home directory
RUN useradd -m -u 1000 user

# Set the user for subsequent instructions
USER user

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

# Set the working directory
WORKDIR /app

# Copy the requirements file into the container
COPY --chown=user ./requirements.txt requirements.txt

# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

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

# Make sure uvicorn is installed and available in the PATH
RUN pip install --user uvicorn

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