|
@@ -0,0 +1,104 @@
|
|
|
|
|
+services:
|
|
|
|
|
+ # PostgreSQL with pgvector
|
|
|
|
|
+ db:
|
|
|
|
|
+ image: pgvector/pgvector:pg16
|
|
|
|
|
+ container_name: zhagent-db
|
|
|
|
|
+ restart: always
|
|
|
|
|
+ environment:
|
|
|
|
|
+ POSTGRES_DB: maxkb
|
|
|
|
|
+ POSTGRES_USER: postgres
|
|
|
|
|
+ POSTGRES_PASSWORD: ${DB_PASSWORD:-zhagent123}
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - "5432:5432"
|
|
|
|
|
+ volumes:
|
|
|
|
|
+ - ./data/postgresql:/var/lib/postgresql/data
|
|
|
|
|
+ healthcheck:
|
|
|
|
|
+ test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
|
|
|
+ interval: 10s
|
|
|
|
|
+ timeout: 5s
|
|
|
|
|
+ retries: 5
|
|
|
|
|
+
|
|
|
|
|
+ # Redis
|
|
|
|
|
+ redis:
|
|
|
|
|
+ image: redis:7-alpine
|
|
|
|
|
+ container_name: zhagent-redis
|
|
|
|
|
+ restart: always
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - "6379:6379"
|
|
|
|
|
+ volumes:
|
|
|
|
|
+ - ./data/redis:/data
|
|
|
|
|
+ healthcheck:
|
|
|
|
|
+ test: ["CMD", "redis-cli", "ping"]
|
|
|
|
|
+ interval: 10s
|
|
|
|
|
+ timeout: 5s
|
|
|
|
|
+ retries: 5
|
|
|
|
|
+
|
|
|
|
|
+ # Django Web
|
|
|
|
|
+ web:
|
|
|
|
|
+ build: .
|
|
|
|
|
+ container_name: zhagent-web
|
|
|
|
|
+ restart: always
|
|
|
|
|
+ command: python main.py dev web
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - "8080:8080"
|
|
|
|
|
+ environment:
|
|
|
|
|
+ - MAXKB_CONFIG_TYPE=ENV
|
|
|
|
|
+ - MAXKB_DB_HOST=db
|
|
|
|
|
+ - MAXKB_DB_PORT=5432
|
|
|
|
|
+ - MAXKB_DB_USER=postgres
|
|
|
|
|
+ - MAXKB_DB_PASSWORD=${DB_PASSWORD:-zhagent123}
|
|
|
|
|
+ - MAXKB_DB_NAME=maxkb
|
|
|
|
|
+ - MAXKB_REDIS_HOST=redis
|
|
|
|
|
+ - MAXKB_REDIS_PORT=6379
|
|
|
|
|
+ - MAXKB_REDIS_PASSWORD=
|
|
|
|
|
+ - MAXKB_REDIS_DB=0
|
|
|
|
|
+ - MAXKB_DEBUG=false
|
|
|
|
|
+ volumes:
|
|
|
|
|
+ - ./data/uploads:/app/uploads
|
|
|
|
|
+ - ./apps/static:/app/apps/static
|
|
|
|
|
+ depends_on:
|
|
|
|
|
+ db:
|
|
|
|
|
+ condition: service_healthy
|
|
|
|
|
+ redis:
|
|
|
|
|
+ condition: service_healthy
|
|
|
|
|
+
|
|
|
|
|
+ # Celery Worker
|
|
|
|
|
+ celery:
|
|
|
|
|
+ build: .
|
|
|
|
|
+ container_name: zhagent-celery
|
|
|
|
|
+ restart: always
|
|
|
|
|
+ command: python main.py dev celery
|
|
|
|
|
+ environment:
|
|
|
|
|
+ - MAXKB_CONFIG_TYPE=ENV
|
|
|
|
|
+ - MAXKB_DB_HOST=db
|
|
|
|
|
+ - MAXKB_DB_PORT=5432
|
|
|
|
|
+ - MAXKB_DB_USER=postgres
|
|
|
|
|
+ - MAXKB_DB_PASSWORD=${DB_PASSWORD:-zhagent123}
|
|
|
|
|
+ - MAXKB_DB_NAME=maxkb
|
|
|
|
|
+ - MAXKB_REDIS_HOST=redis
|
|
|
|
|
+ - MAXKB_REDIS_PORT=6379
|
|
|
|
|
+ - MAXKB_REDIS_PASSWORD=
|
|
|
|
|
+ - MAXKB_REDIS_DB=0
|
|
|
|
|
+ - MAXKB_DEBUG=false
|
|
|
|
|
+ volumes:
|
|
|
|
|
+ - ./data/uploads:/app/uploads
|
|
|
|
|
+ depends_on:
|
|
|
|
|
+ db:
|
|
|
|
|
+ condition: service_healthy
|
|
|
|
|
+ redis:
|
|
|
|
|
+ condition: service_healthy
|
|
|
|
|
+
|
|
|
|
|
+ # Nginx for frontend
|
|
|
|
|
+ nginx:
|
|
|
|
|
+ image: nginx:alpine
|
|
|
|
|
+ container_name: zhagent-nginx
|
|
|
|
|
+ restart: always
|
|
|
|
|
+ ports:
|
|
|
|
|
+ - "80:80"
|
|
|
|
|
+ volumes:
|
|
|
|
|
+ - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
|
|
|
+ - ./ui/admin/dist:/usr/share/nginx/admin:ro
|
|
|
|
|
+ - ./ui/builder/dist:/usr/share/nginx/builder:ro
|
|
|
|
|
+ - ./ui/chat/dist:/usr/share/nginx/chat:ro
|
|
|
|
|
+ depends_on:
|
|
|
|
|
+ - web
|