From 42b7ec95bfc6982320de63a65a98345e35037b59 Mon Sep 17 00:00:00 2001 From: ytqh Date: Wed, 2 Jul 2025 17:33:14 +0800 Subject: [PATCH] Integrate admin platform into Docker Compose stack MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add admin service to docker-compose.yaml and docker-compose-template.yaml - Uses akiyu303/jim-admin:latest image - Configurable API URL via ADMIN_API_URL env var (defaults to https://qingsu.chat) - Includes health check on /admin endpoint - Update nginx configuration to route /admin to admin container - Changed from host.docker.internal:3000 to admin:3000 - Admin service now runs within Docker network - Add admin service as nginx dependency to ensure proper startup order This allows the admin platform to run as part of the complete jim-dify stack instead of requiring a separate local development server. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- docker/docker-compose-template.yaml | 15 +++++++++++++++ docker/docker-compose.yaml | 15 +++++++++++++++ docker/nginx/conf.d/default.conf.template | 2 +- 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docker/docker-compose-template.yaml b/docker/docker-compose-template.yaml index accea0a252..cb78381e24 100644 --- a/docker/docker-compose-template.yaml +++ b/docker/docker-compose-template.yaml @@ -115,6 +115,20 @@ services: ENABLE_WEBSITE_JINAREADER: ${ENABLE_WEBSITE_JINAREADER:-true} ENABLE_WEBSITE_FIRECRAWL: ${ENABLE_WEBSITE_FIRECRAWL:-true} ENABLE_WEBSITE_WATERCRAWL: ${ENABLE_WEBSITE_WATERCRAWL:-true} + + # Admin platform frontend + admin: + image: akiyu303/jim-admin:latest + restart: always + environment: + NEXT_PUBLIC_API_URL: ${ADMIN_API_URL:-https://qingsu.chat} + depends_on: + - api + healthcheck: + test: [ 'CMD', 'curl', '-f', 'http://localhost:3000/admin' ] + interval: 30s + timeout: 10s + retries: 3 # The postgres database. db: image: postgres:15-alpine @@ -308,6 +322,7 @@ services: depends_on: - api - web + - admin ports: - '${EXPOSE_NGINX_PORT:-80}:${NGINX_PORT:-80}' - '${EXPOSE_NGINX_SSL_PORT:-443}:${NGINX_SSL_PORT:-443}' diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 37f4736201..c2bee2ffe6 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -627,6 +627,20 @@ services: ENABLE_WEBSITE_JINAREADER: ${ENABLE_WEBSITE_JINAREADER:-true} ENABLE_WEBSITE_FIRECRAWL: ${ENABLE_WEBSITE_FIRECRAWL:-true} ENABLE_WEBSITE_WATERCRAWL: ${ENABLE_WEBSITE_WATERCRAWL:-true} + + # Admin platform frontend + admin: + image: akiyu303/jim-admin:latest + restart: always + environment: + NEXT_PUBLIC_API_URL: ${ADMIN_API_URL:-https://qingsu.chat} + depends_on: + - api + healthcheck: + test: [ 'CMD', 'curl', '-f', 'http://localhost:3000/admin' ] + interval: 30s + timeout: 10s + retries: 3 # The postgres database. db: image: postgres:15-alpine @@ -820,6 +834,7 @@ services: depends_on: - api - web + - admin ports: - '${EXPOSE_NGINX_PORT:-80}:${NGINX_PORT:-80}' - '${EXPOSE_NGINX_SSL_PORT:-443}:${NGINX_SSL_PORT:-443}' diff --git a/docker/nginx/conf.d/default.conf.template b/docker/nginx/conf.d/default.conf.template index 2e4fe224fa..4bddc40f77 100644 --- a/docker/nginx/conf.d/default.conf.template +++ b/docker/nginx/conf.d/default.conf.template @@ -46,7 +46,7 @@ server { } location /admin { - proxy_pass http://host.docker.internal:3000; + proxy_pass http://admin:3000; include proxy.conf; }