File size: 745 Bytes
be84b83
 
 
 
e49104b
be84b83
 
e49104b
be84b83
 
e49104b
be84b83
 
 
 
 
e49104b
be84b83
 
e49104b
 
 
be84b83
e49104b
be84b83
 
e49104b
be84b83
 
 
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
30
31
# Use Official Python image
FROM python:3.9

# Set the working directory
WORKDIR /text2text

# Copy the requirements file into the container
COPY ./requirements.txt /text2text/requirements.txt

# Install the requirements
RUN pip install --no-cache-dir --upgrade -r /text2text/requirements.txt

# Add a new user
RUN useradd -m user

# Switch to the new user
USER user

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

# Set the working directory for the user
WORKDIR $HOME/app

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

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