File size: 691 Bytes
548f58a
39a9087
427fc13
 
 
39a9087
427fc13
 
39a9087
427fc13
39a9087
427fc13
 
 
 
39a9087
427fc13
 
39a9087
427fc13
 
 
 
39a9087
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
FROM python:3.12-slim

# 1. Setup the low-privilege user required by Hugging Face
RUN useradd -m -u 1000 user
USER user

# 2. THE FIX: Add the hidden local bin folder to the system PATH
ENV PATH="/home/user/.local/bin:$PATH"

WORKDIR /home/user/app

# 3. Install dependencies as that user
# We use --chown to make sure 'user' owns the files, not 'root'
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt

# 4. Copy the rest of your app
COPY --chown=user:user . .

# 5. Create the data folder for your PDFs
RUN mkdir -p data

# 6. Launch Chainlit on the HF-mandated port
CMD ["chainlit", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]