File size: 493 Bytes
890a359
 
 
 
 
 
 
 
 
c4d460a
890a359
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
FROM python:3.12.6

# Set working directory inside container
WORKDIR /code

# Copy requirements file (fixing the typo in the filename and path)
COPY ./requirment.txt /code/requirment.txt

# Install dependencies
RUN pip install --no-cache-dir --upgrade -r /code/requirment.txt

# Add a non-root user and switch to it
RUN useradd -m user
USER user

# Copy the FastAPI app code
COPY . /code

# Command to run the app with uvicorn
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]