File size: 967 Bytes
9046e9c
2444848
 
9046e9c
2444848
 
9046e9c
9c3e38c
 
2444848
 
9046e9c
2444848
 
38d5748
2444848
d9f3f82
 
 
 
2444848
 
 
 
 
7d616ed
 
d9f3f82
2444848
 
 
 
 
8c7fc9a
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
31
32
33
34
FROM python:3.11

# Create a user and set the user ID
RUN useradd -m -u 1000 user

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

# Set the working directory
WORKDIR $HOME/app

# Copy the application code and set ownership
COPY --chown=user . $HOME/app

# Ensure the necessary directories exist and have the correct permissions
RUN mkdir -p ${CHAINLIT_USER_FILES_DIR} $HOME/app/.files && \
    chown -R user:user ${CHAINLIT_USER_FILES_DIR} $HOME/app/.files && \
    chmod 777 ${CHAINLIT_USER_FILES_DIR} $HOME/app/.files

# Switch to the user
USER user

# Install dependencies
COPY --chown=user requirements.txt requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install chainlit==0.7.700

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

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