File size: 670 Bytes
9046e9c
7d616ed
 
9046e9c
7d616ed
 
9046e9c
 
7d616ed
 
9046e9c
7d616ed
 
 
 
 
 
 
 
ffab2ce
 
 
 
 
 
7d616ed
ffab2ce
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
FROM python:3.11

# Create a non-root user
RUN useradd -m -u 1000 user

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

# Set the working directory
WORKDIR $HOME/app

# Copy requirements file and install dependencies
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

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

# Ensure the user has full permissions in the working directory
RUN chown -R user:user $HOME/app && chmod -R 755 $HOME/app

# Switch to the new user
USER user

# Command to run the application
CMD ["chainlit", "run", "final.py", "--port", "7860"]