File size: 762 Bytes
351a4b4
 
beffe84
351a4b4
 
 
beffe84
351a4b4
 
 
 
beffe84
351a4b4
 
beffe84
351a4b4
f9f79fd
351a4b4
 
f9f79fd
351a4b4
 
 
 
 
 
 
 
 
e1f2816
beffe84
351a4b4
6d8de0b
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
# Use Python 3.10 as base image
FROM python:3.10-slim

# Create and set non-root user for security
RUN useradd -m -u 1000 user
USER user

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

# Set working directory
WORKDIR $HOME/app

# Copy requirements file first to leverage Docker cache
COPY --chown=user pyproject.toml .

# Install dependencies
RUN pip install --no-cache-dir --upgrade -e .

# Create and set permissions for chainlit files directory
RUN mkdir -p $HOME/app/.files && \
    mkdir -p $HOME/.chainlit

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

# Expose the port
EXPOSE 7860

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