File size: 789 Bytes
3ba2827
9747cab
3ba2827
 
9747cab
3ba2827
 
9747cab
3ba2827
 
9747cab
3ba2827
 
9747cab
3ba2827
 
9747cab
3ba2827
 
9747cab
3ba2827
 
9747cab
3ba2827
 
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
FROM python:3.9

# Create a user named 'user' with UID 1000 and create its home directory
RUN useradd -m -u 1000 user

# Switch to the 'user' user for subsequent commands
USER user

# Add user's local bin directory to the PATH environment variable
ENV PATH="/home/user/.local/bin:$PATH"

# Set the working directory inside the container
WORKDIR /app

# Copy requirements.txt from the host to the container
COPY --chown=user ./requirements.txt requirements.txt

# Install Python dependencies listed in requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the rest of the application code from the host to the container
COPY --chown=user . /app

# Specify the command to run the application with Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]