File size: 629 Bytes
a16181d
 
aeec554
 
 
a16181d
aeec554
 
a16181d
aeec554
 
a16181d
aeec554
 
 
a16181d
aeec554
 
a16181d
aeec554
a16181d
aeec554
a16181d
aeec554
 
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
FROM python:3.9

# Set up non-root user
RUN useradd -m -u 1000 user
USER user

# Set working directory
WORKDIR /home/user/app

# Install system dependencies (if any)
# RUN apt-get update && apt-get install -y ...

# Install Python dependencies
COPY ./requirements.txt /home/user/app/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /home/user/app/requirements.txt

# Copy only necessary files
COPY --chown=user . /home/user/app

# Set environment variables
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

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