File size: 715 Bytes
942c944
6fd68d7
 
942c944
6fd68d7
 
942c944
 
6fd68d7
 
942c944
6fd68d7
 
 
942c944
8dd40cc
6fd68d7
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.9

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

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

# Set the working directory
WORKDIR $HOME/app

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

# Copy the entire project and take ownership
COPY --chown=user:user . $HOME/app

# Create and adjust permissions for data directory
RUN mkdir -p $HOME/app/data/embeddings && \
    chown -R user:user $HOME/app/data

# Use the non-root user to run the app
USER user

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