WebHub360 commited on
Commit
b5c7511
·
verified ·
1 Parent(s): f375d99

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -35
Dockerfile CHANGED
@@ -1,8 +1,6 @@
1
  FROM ghcr.io/huggingface/chat-ui:latest AS chat-ui
2
- FROM ghcr.io/huggingface/text-generation-inference:latest AS tgi
3
 
4
- # Start with NVIDIA CUDA image for GPU support
5
- FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
6
 
7
  ARG MODEL_NAME=NousResearch/Hermes-3-Llama-3.1-8B
8
  ENV MODEL_NAME=${MODEL_NAME}
@@ -12,37 +10,18 @@ ENV TZ=Europe/Paris \
12
  DEBIAN_FRONTEND=noninteractive \
13
  PORT=3000
14
 
15
- # Pre-set timezone to avoid prompts
16
- RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
17
-
18
- # Install system dependencies
19
- RUN apt-get update && apt-get install -y --no-install-recommends \
20
- curl \
21
- wget \
22
- gnupg \
23
- git \
24
- ca-certificates \
25
- python3 \
26
- python3-pip \
27
- python3-setuptools \
28
- && rm -rf /var/lib/apt/lists/*
29
-
30
  # Install Node.js
31
- RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
32
- && apt-get update \
33
- && apt-get install -y --no-install-recommends nodejs \
34
- && rm -rf /var/lib/apt/lists/*
35
-
36
- # Copy text-generation-inference binaries and libraries from TGI image
37
- COPY --from=tgi /usr/local/bin/text-generation-launcher /usr/local/bin/
38
- COPY --from=tgi /usr/local/bin/text-generation-server /usr/local/bin/
39
- COPY --from=tgi /usr/local/lib/libtext_generation_inference* /usr/local/lib/
40
 
41
- # Ensure libraries are found
42
- ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
43
 
44
- # Setup for chat-ui
45
- RUN useradd -m -u 1000 user
46
  RUN mkdir -p /app && chown -R 1000:1000 /app
47
 
48
  # Switch to user
@@ -50,9 +29,9 @@ USER user
50
  ENV HOME=/home/user \
51
  PATH=/home/user/.local/bin:$PATH
52
 
53
- # Install dotenv-cli
54
- RUN npm config set prefix /home/user/.local
55
- RUN npm install -g dotenv-cli
56
 
57
  # Copy chat-ui from base image
58
  COPY --from=chat-ui --chown=1000 /app/node_modules /app/node_modules
@@ -60,7 +39,7 @@ COPY --from=chat-ui --chown=1000 /app/package.json /app/package.json
60
  COPY --from=chat-ui --chown=1000 /app/build /app/build
61
  COPY --from=chat-ui --chown=1000 /app/.env /app/.env
62
 
63
- # Copy configuration files
64
  COPY --chown=1000 .env.local /app/.env.local
65
  COPY --chown=1000 entrypoint.sh /app/entrypoint.sh
66
  RUN chmod +x /app/entrypoint.sh
 
1
  FROM ghcr.io/huggingface/chat-ui:latest AS chat-ui
 
2
 
3
+ FROM ghcr.io/huggingface/text-generation-inference:latest
 
4
 
5
  ARG MODEL_NAME=NousResearch/Hermes-3-Llama-3.1-8B
6
  ENV MODEL_NAME=${MODEL_NAME}
 
10
  DEBIAN_FRONTEND=noninteractive \
11
  PORT=3000
12
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  # Install Node.js
14
+ RUN apt-get update && \
15
+ apt-get install -y --no-install-recommends curl && \
16
+ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
17
+ apt-get update && \
18
+ apt-get install -y --no-install-recommends nodejs && \
19
+ rm -rf /var/lib/apt/lists/*
 
 
 
20
 
21
+ # Create user if not exists
22
+ RUN id -u user &>/dev/null || useradd -m -u 1000 user
23
 
24
+ # Setup directories
 
25
  RUN mkdir -p /app && chown -R 1000:1000 /app
26
 
27
  # Switch to user
 
29
  ENV HOME=/home/user \
30
  PATH=/home/user/.local/bin:$PATH
31
 
32
+ # Install npm tools
33
+ RUN npm config set prefix /home/user/.local && \
34
+ npm install -g dotenv-cli
35
 
36
  # Copy chat-ui from base image
37
  COPY --from=chat-ui --chown=1000 /app/node_modules /app/node_modules
 
39
  COPY --from=chat-ui --chown=1000 /app/build /app/build
40
  COPY --from=chat-ui --chown=1000 /app/.env /app/.env
41
 
42
+ # Copy your config files
43
  COPY --chown=1000 .env.local /app/.env.local
44
  COPY --chown=1000 entrypoint.sh /app/entrypoint.sh
45
  RUN chmod +x /app/entrypoint.sh