File size: 1,746 Bytes
985e74e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM node:19 as chatui-builder

WORKDIR /app

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        git && \
        rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/huggingface/chat-ui.git

WORKDIR /app/chat-ui

RUN --mount=type=cache,target=/app/.npm \
        npm set cache /app/.npm && \
        npm ci

COPY .env.local .env.local
RUN npm run build

FROM ghcr.io/huggingface/text-generation-inference:latest

ENV TZ=Europe/Paris

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        gnupg \
        curl && \
        rm -rf /var/lib/apt/lists/*

RUN curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
    gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
    --dearmor

RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        mongodb-org && \
        rm -rf /var/lib/apt/lists/*

RUN mkdir -p /data/db

RUN curl -fsSL https://deb.nodesource.com/setup_19.x | /bin/bash -

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        nodejs && \
        rm -rf /var/lib/apt/lists/*

RUN npm install -g pm2
RUN mkdir /app

COPY --from=chatui-builder /app/chat-ui/node_modules /app/node_modules
COPY --from=chatui-builder /app/chat-ui/package.json /app/package.json
COPY --from=chatui-builder /app/chat-ui/build /app/build

COPY entrypoint.sh entrypoint.sh
RUN chmod +x entrypoint.sh

ENTRYPOINT ["./entrypoint.sh"]