adowu commited on
Commit
080c68a
·
verified ·
1 Parent(s): 6475989

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +40 -52
Dockerfile CHANGED
@@ -1,60 +1,48 @@
1
- FROM ghcr.io/huggingface/chat-ui:latest AS base
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
 
3
- FROM ghcr.io/huggingface/text-generation-inference:latest AS final
4
-
5
- ARG MODEL_NAME
6
- ENV MODEL_NAME=${MODEL_NAME}
7
-
8
- ENV TZ=Europe/Paris \
9
- PORT=3000
10
-
11
- # mongo installation
12
- RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
13
- gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
14
- --dearmor
15
-
16
- RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list
17
-
18
- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
19
- mongodb-org && \
20
- rm -rf /var/lib/apt/lists/*
21
-
22
- # node installation
23
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | /bin/bash -
24
-
25
- RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
26
- nodejs && \
27
- rm -rf /var/lib/apt/lists/*
28
-
29
- # image setup
30
  RUN useradd -m -u 1000 user
31
-
32
- RUN mkdir /app
33
- RUN chown -R 1000:1000 /app
34
  RUN mkdir /data
35
- RUN chown -R 1000:1000 /data
36
 
37
- # Switch to the "user" user
38
- USER user
39
 
 
40
  ENV HOME=/home/user \
41
  PATH=/home/user/.local/bin:$PATH
42
 
43
- RUN npm config set prefix /home/user/.local
44
- RUN npm install -g dotenv-cli
45
-
46
-
47
- # copy chat-ui from base image
48
- COPY --from=base --chown=1000 /app/node_modules /app/node_modules
49
- COPY --from=base --chown=1000 /app/package.json /app/package.json
50
- COPY --from=base --chown=1000 /app/build /app/build
51
-
52
- COPY --from=base --chown=1000 /app/.env /app/.env
53
- COPY --chown=1000 .env.local /app/.env.local
54
-
55
- COPY --chown=1000 entrypoint.sh /app/entrypoint.sh
56
-
57
- RUN chmod +x /app/entrypoint.sh
58
-
59
- # entrypoint
60
- ENTRYPOINT [ "/app/entrypoint.sh" ]
 
1
+ FROM python:3.11-slim AS base
2
+
3
+ WORKDIR /app
4
+
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ wget \
7
+ unzip \
8
+ libx11-xcb1 \
9
+ libxcomposite1 \
10
+ libxcursor1 \
11
+ libxdamage1 \
12
+ libxi6 \
13
+ libxtst6 \
14
+ libnss3 \
15
+ libcups2 \
16
+ libxss1 \
17
+ libxrandr2 \
18
+ libasound2 \
19
+ libatk1.0-0 \
20
+ libatk-bridge2.0-0 \
21
+ libcairo2 \
22
+ libgdk-pixbuf2.0-0 \
23
+ libgtk-3-0 \
24
+ libpango-1.0-0 \
25
+ libpangocairo-1.0-0 \
26
+ libx11-6 \
27
+ xvfb \
28
+ && rm -rf /var/lib/apt/lists/*
29
+
30
+ COPY . /app/
31
+
32
+ RUN pip install --no-cache-dir -r requirements.txt
33
+
34
+ ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
35
+ RUN mkdir -p $PLAYWRIGHT_BROWSERS_PATH && playwright install chromium --with-deps
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  RUN useradd -m -u 1000 user
 
 
 
38
  RUN mkdir /data
39
+ RUN chown -R 1000:1000 /app /data
40
 
41
+ COPY entrypoint.sh /app/entrypoint.sh
42
+ RUN chmod +x /app/entrypoint.sh
43
 
44
+ USER user
45
  ENV HOME=/home/user \
46
  PATH=/home/user/.local/bin:$PATH
47
 
48
+ ENTRYPOINT ["xvfb-run", "/app/entrypoint.sh"]