File size: 807 Bytes
ec391cc
337bea5
 
 
 
 
 
 
 
ec391cc
 
 
337bea5
 
ec391cc
337bea5
 
 
 
 
 
 
 
 
 
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
FROM python:3.9

# Create a user with UID 1000 and create the necessary directories with appropriate permissions
RUN useradd -m -u 1000 user && \
    mkdir /home/user/app && \
    chown user:user /home/user/app -R && \
    chmod 755 /home/user/app -R

# Switch to the new user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory (this will automatically switch to this directory)
WORKDIR $HOME/app

# Install dependencies
# Note: Copying requirements.txt separately allows Docker to cache the installed packages unless requirements.txt changes
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of your application's code
COPY --chown=user:user . .

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