File size: 741 Bytes
678c767
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
950f846
 
 
 
678c767
 
 
 
 
 
 
2a30047
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
FROM python:3.11

# Create user
RUN useradd -m -u 1000 user

# Set working directory
WORKDIR /home/user/app

# Create necessary directories with correct permissions
RUN mkdir -p /home/user/app/public
RUN mkdir -p /home/user/app/logs
RUN chown -R user:user /home/user/app

# Copy requirements first
COPY --chown=user requirements.txt .
RUN pip install -r requirements.txt

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

# HF Spaces specific: Listen on 0.0.0.0 to accept external connections
ENV HOST=0.0.0.0
ENV PORT=7860

# Document that the container listens on port 7860
EXPOSE 7860

# Set user
USER user

# Command to run the application
CMD ["chainlit", "run", "scripts/demo.py",  "--port", "7860", "--host", "0.0.0.0", "-h"]