forked from serge-chat/serge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
61 lines (40 loc) · 1.42 KB
/
Dockerfile
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
55
56
57
58
59
60
61
FROM gcc:11 as llama_builder
WORKDIR /tmp
RUN git clone https://github.com/ggerganov/llama.cpp.git --branch master-d5850c5
RUN cd llama.cpp && \
make && \
mv main llama
# Copy over rest of the project files
FROM ubuntu:22.04 as deployment
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/Amsterdam
WORKDIR /usr/src/app
# install pip
RUN apt update
RUN apt-get install -y python3-pip curl wget
RUN pip install --upgrade pip
# install nodejs
RUN curl -sL https://deb.nodesource.com/setup_19.x | bash
RUN apt-get install nodejs
# MongoDB
RUN wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | apt-key add -
RUN echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list
RUN apt-get update
RUN apt-get install -y mongodb-org
# install requirements
COPY ./api/requirements.txt api/requirements.txt
RUN pip install -r ./api/requirements.txt
# copy llama binary from llama_builder
COPY --from=llama_builder /tmp/llama.cpp/llama /usr/bin/llama
# copy built webserver from web_builder
COPY ./web/package.json web/
COPY ./web/package-lock.json web/
# Install Node modules
RUN cd web && npm install
COPY ./web /usr/src/app/web/
#copy api folder
COPY ./api /usr/src/app/api
# get the deploy script with the right permissions
COPY deploy.sh /usr/src/app/deploy.sh
RUN chmod +x /usr/src/app/deploy.sh
CMD /usr/src/app/deploy.sh