File size: 599 Bytes
c4e25ba
 
2c5ed72
c4e25ba
 
 
2c5ed72
c4e25ba
2c5ed72
c4e25ba
4d19bbd
c4e25ba
 
c68eaba
c4e25ba
 
 
2c5ed72
 
 
c4e25ba
b7bb791
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# This image comes with llama-cpp-python PRE-INSTALLED and optimized
FROM ghcr.io/abetlen/llama-cpp-python:latest

# Switch to root to set up the HF user
USER root
RUN apt-get update && apt-get install -y curl git procps && rm -rf /var/lib/apt/lists/*

# Setup HF compatible user
RUN useradd -m -u 1000 user
WORKDIR /home/user/app

# Install the few extra things we need
RUN pip install --no-cache-dir gradio huggingface-hub hf-transfer

# Give permissions to the user
RUN chown -R user:user /home/user/app
USER user

COPY --chown=user . .

# Use the same app.py logic
CMD ["python", "-u", "app.py"]