File size: 710 Bytes
4f6911e
 
c129701
 
8c6af9b
c129701
 
4f6911e
c129701
 
 
4f6911e
c129701
 
0e6eea9
 
c129701
 
8c6af9b
d843ce3
 
 
c129701
 
8c6af9b
 
4f6911e
8c6af9b
 
c129701
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
FROM python:3.9-slim

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

# Set the working directory
WORKDIR /home/user/app

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

# Copy requirements.txt and install dependencies
COPY --chown=user:user requirements.txt /home/user/app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY --chown=user:user . /home/user/app

# Ensure the user has write permissions to the working directory
RUN chown -R user:user /home/user/app

# Switch to the non-root user
USER user

# Expose port 7860
EXPOSE 7860

# Run the app
CMD ["chainlit", "run", "app.py", "--port", "7860"]