File size: 925 Bytes
0391c51
 
 
 
c45a943
7cbdbbe
 
0391c51
9f30d53
 
 
 
 
 
 
1ec856f
0391c51
 
1ec856f
0391c51
 
 
 
7cbdbbe
0391c51
9f30d53
 
0391c51
 
 
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
# Use an alias for the base image for easier updates
FROM python:3.10 as base

# Set model
ENV MODEL=gguf/Smaug-34B-v0.1-GGUF
ENV QUANT=Q2_K
ENV CHAT_TEMPLATE=chatml

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Install Python requirements
COPY ./requirements.txt $HOME/app/
RUN pip install --no-cache-dir --upgrade -r requirements.txt

# Download model
RUN MODEL_NAME_FILE=$(echo ${MODEL#*/} | tr '[:upper:]' '[:lower:]' | sed 's/-gguf$//') && \
    wget https://huggingface.co/gguf/Smaug-34B-v0.1-GGUF/resolve/main/smaug-34b-v0.1.Q2_K.gguf -O model.gguf

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

# Command to run the application
CMD ["python", "app.py"]