File size: 2,206 Bytes
ab1439e
 
 
0383b54
ab1439e
 
 
0383b54
ab1439e
 
 
0383b54
ab1439e
0383b54
8ac1be9
 
 
ce29d34
cf45bb0
db291a1
 
 
 
 
 
 
 
 
 
ce29d34
db291a1
 
b299a1e
 
 
db291a1
 
 
 
 
ab1439e
 
 
ce338c6
ab1439e
db291a1
ce338c6
 
db291a1
 
ce29d34
 
ff51f98
8d38c43
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# syntax=docker/dockerfile:1

FROM ubuntu:22.04

ARG CHAT_MODEL_FILE
ARG EMBEDDING_MODEL_FILE
ARG PROMPT_TEMPLATE

ENV CHAT_MODEL_FILE=${CHAT_MODEL_FILE}
ENV EMBEDDING_MODEL_FILE=${EMBEDDING_MODEL_FILE}
ENV PROMPT_TEMPLATE=${PROMPT_TEMPLATE}

RUN apt-get update && apt-get install -y curl

#COPY $CHAT_MODEL_FILE /models/$CHAT_MODEL_FILE
#COPY $EMBEDDING_MODEL_FILE /models/$EMBEDDING_MODEL_FILE

#RUN mkdir /app && chmod -R 777 /app && cd /app

# Set up a new user named "user" with user ID 1000
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

#RUN mkdir $HOME/models && cd $HOME/models
# Set the working directory to the user's home directory
WORKDIR $HOME/models
#ADD --chown=user https://huggingface.co/second-state/Nomic-embed-text-v1.5-Embedding-GGUF/resolve/main/nomic-embed-text-v1.5-f16.gguf $HOME/models
RUN curl -LO https://huggingface.co/second-state/Llama-3-8B-Instruct-GGUF/resolve/main/Meta-Llama-3-8B-Instruct-Q5_K_M.gguf 
RUN curl -LO https://huggingface.co/second-state/Nomic-embed-text-v1.5-Embedding-GGUF/resolve/main/nomic-embed-text-v1.5-f16.gguf

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

# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
RUN curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install_v2.sh | bash -s -- -v 0.13.5
RUN curl -LO https://github.com/LlamaEdge/LlamaEdge/releases/latest/download/llama-api-server.wasm
RUN curl -LO https://github.com/second-state/chatbot-ui/releases/latest/download/chatbot-ui.tar.gz; tar xzf chatbot-ui.tar.gz; rm chatbot-ui.tar.gz
#COPY run.sh .

# Copy the current directory contents into the container at $HOME/app setting the owner to the user
COPY --chown=user . $HOME/app
RUN chmod +x run.sh

# Download a checkpoint
#RUN mkdir content
#ADD --chown=user https://huggingface.co/second-state/Nomic-embed-text-v1.5-Embedding-GGUF/resolve/main/nomic-embed-text-v1.5-f16.gguf content/models

ENTRYPOINT $HOME/app/run.sh $HOME/models/$CHAT_MODEL_FILE $HOME/models/$EMBEDDING_MODEL_FILE $PROMPT_TEMPLATE "$@"