File size: 806 Bytes
4b6ac7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Use an official lightweight Python image matching your project
FROM python:3.11-slim

# Set up a new user named "user" for security (Hugging Face requirement)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# Set the working directory inside the container
WORKDIR $HOME/app

# Copy your local requirements file and install dependencies
COPY --chown=user requirements.txt $HOME/app/
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Copy the rest of your application code into the container
COPY --chown=user . $HOME/app

# Chainlit runs on port 7860 by default on Hugging Face Spaces
EXPOSE 7860

# The command to start your Chainlit app
CMD ["chainlit", "run", "solutions/langchain/chatpdf.py", "--host", "0.0.0.0", "--port", "7860", "-h"]