Update Dockerfile
Browse files- Dockerfile +38 -2
Dockerfile
CHANGED
|
@@ -1,3 +1,39 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM node:20-bookworm-slim
|
| 2 |
|
| 3 |
+
# 设置非交互式安装
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
ENV PORT=7860
|
| 6 |
+
ENV HOST=0.0.0.0
|
| 7 |
+
|
| 8 |
+
# 安装 MongoDB、curl、git、ca-certificates 等系统依赖
|
| 9 |
+
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 10 |
+
curl \
|
| 11 |
+
gnupg \
|
| 12 |
+
ca-certificates \
|
| 13 |
+
git \
|
| 14 |
+
python3 \
|
| 15 |
+
make \
|
| 16 |
+
g++ \
|
| 17 |
+
procps \
|
| 18 |
+
&& curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | gpg --dearmor -o /usr/share/keyrings/mongodb-server-7.0.gpg \
|
| 19 |
+
&& echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/debian bookworm/mongodb-org/7.0 main" | tee /etc/apt/sources.list.d/mongodb-org-7.0.list \
|
| 20 |
+
&& apt-get update \
|
| 21 |
+
&& apt-get install -y --no-install-recommends mongodb-org-server \
|
| 22 |
+
&& apt-get clean \
|
| 23 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 24 |
+
|
| 25 |
+
WORKDIR /app
|
| 26 |
+
|
| 27 |
+
# 拉取 LibreChat 最新源码并构建
|
| 28 |
+
RUN git clone https://github.com/danny-avila/LibreChat.git . \
|
| 29 |
+
&& npm ci \
|
| 30 |
+
&& npm run frontend
|
| 31 |
+
|
| 32 |
+
# 创建 entrypoint 脚本与相关目录
|
| 33 |
+
COPY entrypoint.sh /app/entrypoint.sh
|
| 34 |
+
RUN chmod +x /app/entrypoint.sh
|
| 35 |
+
|
| 36 |
+
# 暴露 HF Space 探测端口
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
CMD ["/app/entrypoint.sh"]
|