From 86c85d6b0f31826927f0bc019297193575e4fe25 Mon Sep 17 00:00:00 2001 From: junjun Date: Mon, 1 Sep 2025 15:18:13 +0800 Subject: [PATCH] build: allinone --- Dockerfile | 7 +++++++ installer/install.conf | 2 +- installer/sqlbot/docker-compose.yml | 2 ++ start.sh | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 31ea12d9..ebeec89a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,6 +45,13 @@ COPY g2-ssr/charts/* /app/charts/ RUN npm install +FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 +ENV PG_PATH=/var/lib/postgresql/data +ENV PG_SH=/usr/local/bin +RUN mkdir -p ${PG_PATH} +COPY --from=registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 ${PG_PATH} ${PG_PATH} +COPY --from=registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6 ${PG_SH} ${PG_SH} + # Runtime stage FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest diff --git a/installer/install.conf b/installer/install.conf index 0146ef90..96c7e05b 100644 --- a/installer/install.conf +++ b/installer/install.conf @@ -9,7 +9,7 @@ SQLBOT_MCP_PORT=8001 ## 是否使用外部数据库 SQLBOT_EXTERNAL_DB=false ## 数据库地址 -SQLBOT_DB_HOST=sqlbot-db +SQLBOT_DB_HOST=localhost ## 数据库端口 (仅使用外部数据库时才生效) SQLBOT_DB_PORT=5432 ## SQLBot 数据库库名 diff --git a/installer/sqlbot/docker-compose.yml b/installer/sqlbot/docker-compose.yml index 42062e3f..6ab010c8 100644 --- a/installer/sqlbot/docker-compose.yml +++ b/installer/sqlbot/docker-compose.yml @@ -8,12 +8,14 @@ services: ports: - ${SQLBOT_WEB_PORT}:8000 - ${SQLBOT_MCP_PORT}:8001 + - 5432:5432 env_file: - conf/sqlbot.conf volumes: - ./data/sqlbot/excel:/opt/sqlbot/data/excel - ./data/sqlbot/images:/opt/sqlbot/images - ./data/sqlbot/logs:/opt/sqlbot/logs + - ./data/postgresql:/var/lib/postgresql/data depends_on: sqlbot-db: condition: service_healthy diff --git a/start.sh b/start.sh index bc4fd998..df3b4c9c 100644 --- a/start.sh +++ b/start.sh @@ -1,5 +1,6 @@ SSR_PATH=/opt/sqlbot/g2-ssr APP_PATH=/opt/sqlbot/app +docker-entrypoint.sh postgres nohup node $SSR_PATH/app.js & nohup uvicorn main:mcp_app --host 0.0.0.0 --port 8001 &