Spaces:
Build error
Build error
add env vars to final stage
Browse files- Dockerfile +17 -3
Dockerfile
CHANGED
@@ -11,12 +11,12 @@ RUN git clone https://github.com/huggingface/chat-ui.git
|
|
11 |
|
12 |
WORKDIR /app/chat-ui
|
13 |
|
14 |
-
RUN mkdir defaults
|
15 |
-
ADD defaults /defaults
|
16 |
-
RUN chmod -R 777 /defaults
|
17 |
|
18 |
COPY .template.env.local .template.env.local
|
19 |
|
|
|
|
|
|
|
20 |
RUN --mount=type=secret,id=MODEL_NAME,mode=0444 \
|
21 |
--mount=type=secret,id=MODEL_PARAMS,mode=0444 \
|
22 |
--mount=type=secret,id=MONGODB_URL,mode=0444 \
|
@@ -42,6 +42,20 @@ FROM ghcr.io/huggingface/text-generation-inference:latest
|
|
42 |
ENV TZ=Europe/Paris \
|
43 |
PORT=3000
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
46 |
gnupg \
|
47 |
curl && \
|
|
|
11 |
|
12 |
WORKDIR /app/chat-ui
|
13 |
|
|
|
|
|
|
|
14 |
|
15 |
COPY .template.env.local .template.env.local
|
16 |
|
17 |
+
RUN mkdir defaults
|
18 |
+
ADD defaults /defaults
|
19 |
+
RUN chmod -R 777 /defaults
|
20 |
RUN --mount=type=secret,id=MODEL_NAME,mode=0444 \
|
21 |
--mount=type=secret,id=MODEL_PARAMS,mode=0444 \
|
22 |
--mount=type=secret,id=MONGODB_URL,mode=0444 \
|
|
|
42 |
ENV TZ=Europe/Paris \
|
43 |
PORT=3000
|
44 |
|
45 |
+
RUN mkdir defaults
|
46 |
+
ADD defaults /defaults
|
47 |
+
RUN chmod -R 777 /defaults
|
48 |
+
RUN --mount=type=secret,id=MODEL_NAME,mode=0444 \
|
49 |
+
--mount=type=secret,id=MODEL_PARAMS,mode=0444 \
|
50 |
+
--mount=type=secret,id=MONGODB_URL,mode=0444 \
|
51 |
+
--mount=type=secret,id=APP_COLOR,mode=0444 \
|
52 |
+
--mount=type=secret,id=APP_NAME,mode=0444 \
|
53 |
+
MODEL_NAME=$(cat /run/secrets/MODEL_NAME 2> /dev/null | grep '^' || cat /defaults/MODEL_NAME) && export MODEL_NAME \
|
54 |
+
&& MODEL_PARAMS=$(cat /run/secrets/MODEL_PARAMS 2> /dev/null | grep '^' ||cat /defaults/MODEL_PARAMS) && export MODEL_PARAMS \
|
55 |
+
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL 2> /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL \
|
56 |
+
&& APP_COLOR=$(cat /run/secrets/APP_COLOR 2> /dev/null | grep '^' || cat /defaults/APP_COLOR) && export APP_COLOR \
|
57 |
+
&& APP_NAME=$(cat /run/secrets/APP_NAME 2> /dev/null | grep '^' || cat /defaults/APP_NAME) && export APP_NAME;
|
58 |
+
|
59 |
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
60 |
gnupg \
|
61 |
curl && \
|