Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +29 -3
Dockerfile
CHANGED
|
@@ -1,12 +1,39 @@
|
|
| 1 |
FROM ghcr.io/huggingface/chat-ui:latest AS base
|
| 2 |
|
| 3 |
-
|
|
|
|
| 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 | \
|
|
@@ -43,7 +70,6 @@ ENV HOME=/home/user \
|
|
| 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
|
|
|
|
| 1 |
FROM ghcr.io/huggingface/chat-ui:latest AS base
|
| 2 |
|
| 3 |
+
# Use a CPU-specific base image for text-generation-inference
|
| 4 |
+
FROM ubuntu:22.04 AS final
|
| 5 |
|
| 6 |
ARG MODEL_NAME
|
| 7 |
ENV MODEL_NAME=${MODEL_NAME}
|
| 8 |
|
| 9 |
ENV TZ=Europe/Paris \
|
| 10 |
+
PORT=3000 \
|
| 11 |
+
HUGGING_FACE_HUB_TOKEN="" \
|
| 12 |
+
MONGO_URL="mongodb://localhost:27017" \
|
| 13 |
+
DB_NAME="chat-ui"
|
| 14 |
+
|
| 15 |
+
# Install system dependencies for a CPU environment
|
| 16 |
+
RUN apt-get update && \
|
| 17 |
+
apt-get install -y --no-install-recommends \
|
| 18 |
+
wget \
|
| 19 |
+
curl \
|
| 20 |
+
git \
|
| 21 |
+
build-essential \
|
| 22 |
+
ca-certificates \
|
| 23 |
+
libssl-dev \
|
| 24 |
+
libopenblas-dev \
|
| 25 |
+
libopenblas-base \
|
| 26 |
+
libatlas-base-dev \
|
| 27 |
+
libgl1-mesa-glx \
|
| 28 |
+
libglib2.0-0 \
|
| 29 |
+
python3 \
|
| 30 |
+
python3-pip \
|
| 31 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 32 |
+
|
| 33 |
+
# Install text-generation-inference from source for CPU optimization
|
| 34 |
+
RUN git clone https://github.com/huggingface/text-generation-inference.git /app/text-generation-inference && \
|
| 35 |
+
cd /app/text-generation-inference && \
|
| 36 |
+
pip3 install --no-cache-dir .
|
| 37 |
|
| 38 |
# mongo installation
|
| 39 |
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
|
|
|
|
| 70 |
RUN npm config set prefix /home/user/.local
|
| 71 |
RUN npm install -g dotenv-cli
|
| 72 |
|
|
|
|
| 73 |
# copy chat-ui from base image
|
| 74 |
COPY --from=base --chown=1000 /app/node_modules /app/node_modules
|
| 75 |
COPY --from=base --chown=1000 /app/package.json /app/package.json
|