Spaces:
Running
on
A10G
Running
on
A10G
fix secrets
Browse files- Dockerfile +37 -37
Dockerfile
CHANGED
|
@@ -18,69 +18,69 @@ RUN --mount=type=cache,target=/app/.npm \
|
|
| 18 |
|
| 19 |
COPY .template.env.local .template.env.local
|
| 20 |
|
| 21 |
-
RUN --mount=type=secret,id=MODEL_NAME,mode=0444,required=true
|
| 22 |
&& export MODEL_NAME
|
| 23 |
|
| 24 |
-
RUN --mount=type=secret,id=PREPROMPT,mode=0444,required=true
|
| 25 |
&& export PREPROMPT
|
| 26 |
|
| 27 |
-
RUN --mount=type=secret,id=MODEL_TEMPERATURE,mode=0444,required=true
|
| 28 |
&& export MODEL_TEMPERATURE
|
| 29 |
|
| 30 |
RUN envsubst < ".template.env.local" > ".env.local"
|
| 31 |
|
| 32 |
RUN npm run build
|
| 33 |
|
| 34 |
-
FROM ghcr.io/huggingface/text-generation-inference:latest
|
| 35 |
|
| 36 |
-
ENV TZ=Europe/Paris \
|
| 37 |
-
|
| 38 |
|
| 39 |
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
|
| 44 |
-
RUN curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
|
| 45 |
-
|
| 46 |
-
|
| 47 |
|
| 48 |
-
RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
| 49 |
|
| 50 |
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
| 51 |
-
|
| 52 |
-
|
| 53 |
|
| 54 |
-
RUN mkdir -p /data/db
|
| 55 |
-
RUN chown -R 1000:1000 /data
|
| 56 |
|
| 57 |
-
RUN curl -fsSL https://deb.nodesource.com/setup_19.x | /bin/bash -
|
| 58 |
|
| 59 |
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
| 60 |
-
|
| 61 |
-
|
| 62 |
|
| 63 |
-
RUN mkdir /app
|
| 64 |
-
RUN chown -R 1000:1000 /app
|
| 65 |
|
| 66 |
-
RUN useradd -m -u 1000 user
|
| 67 |
|
| 68 |
# Switch to the "user" user
|
| 69 |
-
USER user
|
| 70 |
|
| 71 |
-
ENV HOME=/home/user \
|
| 72 |
-
|
| 73 |
|
| 74 |
-
RUN npm config set prefix /home/user/.local
|
| 75 |
-
RUN npm install -g pm2
|
| 76 |
|
| 77 |
-
COPY --from=chatui-builder --chown=1000 /app/chat-ui/node_modules /app/node_modules
|
| 78 |
-
COPY --from=chatui-builder --chown=1000 /app/chat-ui/package.json /app/package.json
|
| 79 |
-
COPY --from=chatui-builder --chown=1000 /app/chat-ui/build /app/build
|
| 80 |
|
| 81 |
-
COPY entrypoint.sh entrypoint.sh
|
| 82 |
|
| 83 |
-
ENTRYPOINT ["/bin/bash"]
|
| 84 |
-
CMD ["entrypoint.sh"]
|
| 85 |
|
| 86 |
|
|
|
|
| 18 |
|
| 19 |
COPY .template.env.local .template.env.local
|
| 20 |
|
| 21 |
+
RUN --mount=type=secret,id=MODEL_NAME,mode=0444,required=true MODEL_NAME=$(cat /run/secrets/MODEL_NAME) \
|
| 22 |
&& export MODEL_NAME
|
| 23 |
|
| 24 |
+
RUN --mount=type=secret,id=PREPROMPT,mode=0444,required=true PREPROMPT=$(cat /run/secrets/PREPROMPT) \
|
| 25 |
&& export PREPROMPT
|
| 26 |
|
| 27 |
+
RUN --mount=type=secret,id=MODEL_TEMPERATURE,mode=0444,required=true MODEL_TEMPERATURE=$(cat /run/secrets/MODEL_TEMPERATURE) \
|
| 28 |
&& export MODEL_TEMPERATURE
|
| 29 |
|
| 30 |
RUN envsubst < ".template.env.local" > ".env.local"
|
| 31 |
|
| 32 |
RUN npm run build
|
| 33 |
|
| 34 |
+
# FROM ghcr.io/huggingface/text-generation-inference:latest
|
| 35 |
|
| 36 |
+
# ENV TZ=Europe/Paris \
|
| 37 |
+
# PORT=3000
|
| 38 |
|
| 39 |
+
# RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
| 40 |
+
# gnupg \
|
| 41 |
+
# curl && \
|
| 42 |
+
# rm -rf /var/lib/apt/lists/*
|
| 43 |
|
| 44 |
+
# RUN curl -fsSL https://pgp.mongodb.com/server-6.0.asc | \
|
| 45 |
+
# gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg \
|
| 46 |
+
# --dearmor
|
| 47 |
|
| 48 |
+
# RUN echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/6.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-6.0.list
|
| 49 |
|
| 50 |
+
# RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
| 51 |
+
# mongodb-org && \
|
| 52 |
+
# rm -rf /var/lib/apt/lists/*
|
| 53 |
|
| 54 |
+
# RUN mkdir -p /data/db
|
| 55 |
+
# RUN chown -R 1000:1000 /data
|
| 56 |
|
| 57 |
+
# RUN curl -fsSL https://deb.nodesource.com/setup_19.x | /bin/bash -
|
| 58 |
|
| 59 |
+
# RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
| 60 |
+
# nodejs && \
|
| 61 |
+
# rm -rf /var/lib/apt/lists/*
|
| 62 |
|
| 63 |
+
# RUN mkdir /app
|
| 64 |
+
# RUN chown -R 1000:1000 /app
|
| 65 |
|
| 66 |
+
# RUN useradd -m -u 1000 user
|
| 67 |
|
| 68 |
# Switch to the "user" user
|
| 69 |
+
# USER user
|
| 70 |
|
| 71 |
+
# ENV HOME=/home/user \
|
| 72 |
+
# PATH=/home/user/.local/bin:$PATH
|
| 73 |
|
| 74 |
+
# RUN npm config set prefix /home/user/.local
|
| 75 |
+
# RUN npm install -g pm2
|
| 76 |
|
| 77 |
+
# COPY --from=chatui-builder --chown=1000 /app/chat-ui/node_modules /app/node_modules
|
| 78 |
+
# COPY --from=chatui-builder --chown=1000 /app/chat-ui/package.json /app/package.json
|
| 79 |
+
# COPY --from=chatui-builder --chown=1000 /app/chat-ui/build /app/build
|
| 80 |
|
| 81 |
+
# COPY entrypoint.sh entrypoint.sh
|
| 82 |
|
| 83 |
+
# ENTRYPOINT ["/bin/bash"]
|
| 84 |
+
# CMD ["entrypoint.sh"]
|
| 85 |
|
| 86 |
|