File size: 810 Bytes
435f733
 
 
 
01b00da
435f733
 
01b00da
 
435f733
 
01b00da
435f733
 
 
01b00da
435f733
 
 
 
 
 
 
 
 
 
 
 
01b00da
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
# Start with the official Python image
FROM python:3.11

# Create a user and set up permissions
RUN useradd -m -u 1000 user

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

# Create the app directory and set permissions before switching to the non-root user
WORKDIR $HOME/app
RUN mkdir -p $HOME/app/.files && chown -R user:user $HOME/app

# Copy files as root and set ownership
COPY --chown=user . $HOME/app

# Switch to the non-root user
USER user

# Copy the requirements file and install dependencies
COPY --chown=user requirements.txt $HOME/app/requirements.txt
RUN pip install --user -r requirements.txt

# Copy the rest of the application files
COPY --chown=user . .

# Define the command to run the application
CMD ["chainlit", "run", "app.py", "--port", "7860"]