# 默认只启动数据库;通过 web profile 启用管理端。 name: chusql services: server: image: ${CHUSQL_IMAGE:-chusql:local} build: context: . init: true restart: unless-stopped stop_grace_period: 30s mem_limit: 512m memswap_limit: 512m pids_limit: 128 cpus: 1.0 environment: CHUSQL_ADMIN_USER: ${CHUSQL_ADMIN_USER:-root} CHUSQL_ADMIN_PASSWORD_FILE: /run/secrets/admin_password secrets: - admin_password ports: - "${CHUSQL_BIND_ADDRESS:-127.0.0.1}:${CHUSQL_TCP_PORT:-7777}:7777" volumes: - data:/var/lib/chusql - logs:/var/log/chusql - ./docker/server.toml:/etc/chusql/server.toml:ro web: image: ${CHUSQL_IMAGE:-chusql:local} command: ["web"] profiles: ["web"] init: true restart: unless-stopped mem_limit: 512m memswap_limit: 512m pids_limit: 128 cpus: 1.0 environment: CHUSQL_ADMIN_USER: ${CHUSQL_ADMIN_USER:-root} depends_on: server: condition: service_healthy ports: - "${CHUSQL_BIND_ADDRESS:-127.0.0.1}:${CHUSQL_WEB_PORT:-7778}:7778" volumes: - ./docker/web.toml:/etc/chusql/web.toml:ro - web_settings:/opt/chusql/resources healthcheck: test: ["CMD", "healthcheck.sh", "web"] interval: 15s timeout: 5s start_period: 15s retries: 5 secrets: admin_password: file: ${CHUSQL_ADMIN_PASSWORD_PATH:-./secrets/admin_password} volumes: data: logs: web_settings: