Files
JuiceWorkStation/docker-compose.yml
T
xiaozhou233 eaecdaf9f5 feat: 控制面板概览页新增 Docker 容器监控
后端新增 GET /api/docker/stats,走 Docker Engine API(unix socket)读取容器状态、CPU/内存/网络/磁盘与端口;前端 /dashboard 概览页展示汇总与容器列表,5 秒自动刷新;compose 只读挂载 docker.sock 并通过 group_add 注入宿主机 docker 组 GID。
2026-10-06 16:12:21 +08:00

36 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
services:
backend:
build:
context: ./backend
image: workstation-server:${BUILD_NUMBER:-latest}
container_name: workstation-server
restart: unless-stopped
expose:
- "9018"
mem_limit: 128m
# 后端镜像以 nonroot 运行,而 docker.sock 属于 root:docker(0660),
# 这里把宿主机的 docker 组 GID 追加为附加组,让其有权限读取 socket。
# DOCKER_GID 由 Jenkinsfile 在部署时按宿主机实际 GID 注入,默认 999(Debian 常见值)。
group_add:
- "${DOCKER_GID:-999}"
volumes:
# 只读挂载 Docker socket,供后端读取容器监控数据(/api/docker/stats)。
- /var/run/docker.sock:/var/run/docker.sock:ro
frontend:
build:
context: ./dashboard
args:
BUILD_NUMBER: ${BUILD_NUMBER:-latest}
COMMIT: ${COMMIT_SHORT:-unknown}
BRANCH: ${GIT_BRANCH:-unknown}
BUILD_TIME: ${BUILD_TIME:-unknown}
image: workstation-dashboard:${BUILD_NUMBER:-latest}
container_name: workstation-dashboard
restart: unless-stopped
mem_limit: 128m
depends_on:
- backend
ports:
- "9019:80"