Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +5 -11
Dockerfile
CHANGED
|
@@ -1,29 +1,23 @@
|
|
| 1 |
-
# 只用 ChatUI 官方镜像(不拉 TGI、不走 Atlas)
|
| 2 |
FROM ghcr.io/huggingface/chat-ui:latest
|
| 3 |
|
| 4 |
ENV TZ=Europe/Paris \
|
| 5 |
PORT=3000
|
| 6 |
|
| 7 |
-
#
|
| 8 |
USER root
|
| 9 |
-
|
| 10 |
-
# 安装 MongoDB 7.0(Ubuntu 22.04,和你之前一致)
|
| 11 |
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
|
| 12 |
-
|
| 13 |
&& echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" \
|
| 14 |
-
|
| 15 |
&& apt-get update \
|
| 16 |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends mongodb-org \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
| 19 |
-
#
|
| 20 |
-
RUN mkdir -p /data/db && chown -R 1000:1000 /data
|
| 21 |
-
|
| 22 |
-
# 切回非 root 以运行应用
|
| 23 |
USER 1000
|
| 24 |
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|
| 25 |
|
| 26 |
-
#
|
| 27 |
COPY --chown=1000 entrypoint.sh /app/entrypoint.sh
|
| 28 |
RUN chmod +x /app/entrypoint.sh
|
| 29 |
ENTRYPOINT ["/app/entrypoint.sh"]
|
|
|
|
|
|
|
| 1 |
FROM ghcr.io/huggingface/chat-ui:latest
|
| 2 |
|
| 3 |
ENV TZ=Europe/Paris \
|
| 4 |
PORT=3000
|
| 5 |
|
| 6 |
+
# 以 root 安装本地 MongoDB 7.0
|
| 7 |
USER root
|
|
|
|
|
|
|
| 8 |
RUN curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
|
| 9 |
+
gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg --dearmor \
|
| 10 |
&& echo "deb [arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" \
|
| 11 |
+
> /etc/apt/sources.list.d/mongodb-org-7.0.list \
|
| 12 |
&& apt-get update \
|
| 13 |
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends mongodb-org \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# 切回非 root 运行
|
|
|
|
|
|
|
|
|
|
| 17 |
USER 1000
|
| 18 |
ENV HOME=/home/user PATH=/home/user/.local/bin:$PATH
|
| 19 |
|
| 20 |
+
# 使用自定义入口
|
| 21 |
COPY --chown=1000 entrypoint.sh /app/entrypoint.sh
|
| 22 |
RUN chmod +x /app/entrypoint.sh
|
| 23 |
ENTRYPOINT ["/app/entrypoint.sh"]
|