Spaces:
Paused
Paused
matthoffner
commited on
Commit
•
5ae28aa
1
Parent(s):
9a39bda
create Dockerfile
Browse files- Dockerfile +46 -0
Dockerfile
ADDED
@@ -0,0 +1,46 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
FROM ubuntu:22.04
|
2 |
+
|
3 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
4 |
+
|
5 |
+
# Update and install necessary dependencies
|
6 |
+
RUN apt update && \
|
7 |
+
apt install --no-install-recommends -y \
|
8 |
+
build-essential \
|
9 |
+
python3 \
|
10 |
+
python3-pip \
|
11 |
+
wget \
|
12 |
+
curl \
|
13 |
+
git \
|
14 |
+
cmake \
|
15 |
+
zlib1g-dev \
|
16 |
+
libblas-dev && \
|
17 |
+
apt clean && \
|
18 |
+
rm -rf /var/lib/apt/lists/*
|
19 |
+
|
20 |
+
WORKDIR /app
|
21 |
+
|
22 |
+
RUN wget https://huggingface.co/itsdotscience/Magicoder-S-DS-6.7B-GGUF/resolve/main/Magicoder-S-DS-6.7B_q8_0.gguf
|
23 |
+
|
24 |
+
RUN git clone https://github.com/ggerganov/llama.cpp.git && \
|
25 |
+
cd llama.cpp && \
|
26 |
+
git submodule init && \
|
27 |
+
git submodule update && \
|
28 |
+
make
|
29 |
+
|
30 |
+
# Create a non-root user for security reasons
|
31 |
+
RUN useradd -m -u 1000 user && \
|
32 |
+
mkdir -p /home/user/app && \
|
33 |
+
cp /app/Magicoder-S-DS-6.7B_q8_0.gguf /home/user/app
|
34 |
+
|
35 |
+
RUN chown user:user /home/user/app/Magicoder-S-DS-6.7B_q8_0.gguf
|
36 |
+
|
37 |
+
USER user
|
38 |
+
ENV HOME=/home/user
|
39 |
+
|
40 |
+
WORKDIR $HOME/app
|
41 |
+
|
42 |
+
# Expose the port
|
43 |
+
EXPOSE 8080
|
44 |
+
|
45 |
+
# Start the llava-server with models
|
46 |
+
CMD ["/app/llama.cpp/server", "--model", "Magicoder-S-DS-6.7B_q8_0.gguf", "--threads", "12", "--host", "0.0.0.0"]
|