File size: 662 Bytes
dba288f
80b4f28
e3b10d6
dba288f
 
e3b10d6
dba288f
fe54b75
dfffe93
3f7f141
dba288f
 
 
dfffe93
dba288f
2c972da
 
ffd4a52
2c972da
 
 
 
 
ffd4a52
c28d081
b0f97ff
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
# Use an official Python runtime as a parent image
FROM python:3.10.9

# Set the working directory in the container
WORKDIR /app

# Copy the current directory contents into the container at /app

COPY requirements.txt /app

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

COPY . /app

# Create a non-root user
RUN useradd -m myuser

# Change the owner of the application directory
RUN chown -R myuser:myuser /app

# Switch to the non-root user
USER myuser

# Start the FastAPI app on port 7860, the default port expected by Spaces
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]