File size: 928 Bytes
2adb19d
08f09f0
 
 
 
2adb19d
08f09f0
 
10a1fa4
08f09f0
2adb19d
08f09f0
 
 
 
 
 
 
2adb19d
08f09f0
2adb19d
 
 
 
 
 
08f09f0
 
 
 
 
 
 
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.10

# We need to set the host to 0.0.0.0 to allow outside access
ENV HOST 0.0.0.0

# Install dependencies
RUN python3 -m pip install --upgrade pip pytest cmake \
    scikit-build setuptools fastapi uvicorn sse-starlette \
    pydantic-settings starlette-context gradio huggingface_hub hf_transfer

# Install llama-cpp-python for CPU
RUN python3 -m pip install llama-cpp-python

RUN useradd -m -u 1000 user
# Switch to the "user" user
USER user
# Set home to the user's home directory
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH \
    PYTHONPATH=$HOME/app \
    PYTHONUNBUFFERED=1 \
    GRADIO_ALLOW_FLAGGING=never \
    GRADIO_NUM_PORTS=1 \
    GRADIO_SERVER_NAME=0.0.0.0 \
    GRADIO_THEME=huggingface \
    SYSTEM=spaces

WORKDIR $HOME/app

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app

CMD ["python3", "app.py"]