Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +6 -5
Dockerfile
CHANGED
@@ -3,7 +3,6 @@ ARG MODEL_PARAMS
|
|
3 |
ARG MODEL_PROMPT_TEMPLATE
|
4 |
ARG APP_COLOR
|
5 |
ARG APP_NAME
|
6 |
-
ARG ENDPOINT
|
7 |
|
8 |
|
9 |
FROM node:19 as chatui-builder
|
@@ -12,7 +11,6 @@ ARG MODEL_PARAMS
|
|
12 |
ARG APP_COLOR
|
13 |
ARG APP_NAME
|
14 |
ARG MODEL_PROMPT_TEMPLATE
|
15 |
-
ARG ENDPOINT
|
16 |
|
17 |
WORKDIR /app
|
18 |
|
@@ -31,15 +29,20 @@ COPY .env.local.template .env.local.template
|
|
31 |
RUN mkdir defaults
|
32 |
ADD defaults /defaults
|
33 |
RUN chmod -R 777 /defaults
|
|
|
|
|
|
|
|
|
|
|
34 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
35 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
36 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
37 |
&& MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE \
|
38 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
39 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
40 |
-
&& ENDPOINT="${ENDPOINT:="$(cat /defaults/ENDPOINT)"}" && export ENDPOINT \
|
41 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
42 |
echo "${MONGODB_URL}" && \
|
|
|
43 |
envsubst < ".env.local.template" > ".env.local" \
|
44 |
&& rm .env.local.template
|
45 |
|
@@ -58,7 +61,6 @@ ARG MODEL_PARAMS
|
|
58 |
ARG MODEL_PROMPT_TEMPLATE
|
59 |
ARG APP_COLOR
|
60 |
ARG APP_NAME
|
61 |
-
ARG ENDPOINT
|
62 |
|
63 |
ENV TZ=Europe/Paris \
|
64 |
PORT=3000
|
@@ -82,7 +84,6 @@ RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
|
82 |
&& MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE \
|
83 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
84 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
85 |
-
&& ENDPOINT="${ENDPOINT:="$(cat /defaults/ENDPOINT)"}" && export ENDPOINT \
|
86 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
87 |
envsubst < "entrypoint.sh.template" > "entrypoint.sh" \
|
88 |
&& rm entrypoint.sh.template
|
|
|
3 |
ARG MODEL_PROMPT_TEMPLATE
|
4 |
ARG APP_COLOR
|
5 |
ARG APP_NAME
|
|
|
6 |
|
7 |
|
8 |
FROM node:19 as chatui-builder
|
|
|
11 |
ARG APP_COLOR
|
12 |
ARG APP_NAME
|
13 |
ARG MODEL_PROMPT_TEMPLATE
|
|
|
14 |
|
15 |
WORKDIR /app
|
16 |
|
|
|
29 |
RUN mkdir defaults
|
30 |
ADD defaults /defaults
|
31 |
RUN chmod -R 777 /defaults
|
32 |
+
|
33 |
+
RUN --mount=type=secret,id=API_URL,mode=0444 \
|
34 |
+
API_URL=$(cat /run/secrets/API_URL) && export API_URL && echo "${API_URL}" >> "/defaults/.api_url" && cat /defaults/.endpoint
|
35 |
+
|
36 |
+
|
37 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
38 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
39 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
40 |
&& MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE \
|
41 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
42 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
|
|
43 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
44 |
echo "${MONGODB_URL}" && \
|
45 |
+
&& API_URL=$(cat /defaults/.api_url) && export API_URL && echo "${API_URL}" \
|
46 |
envsubst < ".env.local.template" > ".env.local" \
|
47 |
&& rm .env.local.template
|
48 |
|
|
|
61 |
ARG MODEL_PROMPT_TEMPLATE
|
62 |
ARG APP_COLOR
|
63 |
ARG APP_NAME
|
|
|
64 |
|
65 |
ENV TZ=Europe/Paris \
|
66 |
PORT=3000
|
|
|
84 |
&& MODEL_PROMPT_TEMPLATE="${MODEL_PROMPT_TEMPLATE:="$(cat /defaults/MODEL_PROMPT_TEMPLATE)"}" && export MODEL_PROMPT_TEMPLATE \
|
85 |
&& APP_COLOR="${APP_COLOR:="$(cat /defaults/APP_COLOR)"}" && export APP_COLOR \
|
86 |
&& APP_NAME="${APP_NAME:="$(cat /defaults/APP_NAME)"}" && export APP_NAME \
|
|
|
87 |
&& MONGODB_URL=$(cat /run/secrets/MONGODB_URL > /dev/null | grep '^' || cat /defaults/MONGODB_URL) && export MONGODB_URL && \
|
88 |
envsubst < "entrypoint.sh.template" > "entrypoint.sh" \
|
89 |
&& rm entrypoint.sh.template
|