Files
testspace/docker-compose.yml
adminandClaude Code 5fd76c5c50 chore: 删根 Dockerfile, 订正 docker-compose.yml 头部
Dockerfile 构建的是 jnpf-claude 开发镜像(ubuntu + Claude Code CLI), 对应
compose 服务块早已整段注释, 全仓库无 build: 段引用, 无容器无镜像, 且违反
§7.1「不重打镜像」。移入回收站。

docker-compose.yml 保留 —— 它是本机正在跑的 jnpf-gitea/jnpf-postgres/
jnpf-redis 三个容器唯一的完整定义, 也是 §1 那几个复用镜像
(liberica-openjre-rocky:21 / nginx:latest) 的唯一出处, 删了 Gitea 无法重建。

- 头部换成实际内容: 只跑 3 个服务, JNPF 服务块已随 K8s 迁移注释掉
- 标注路径陷阱: 挂载全是相对 ./persist/..., 而 persist/ 是 testspace 的
  兄弟目录, 在本目录跑会静默起一套空 PG+Gitea 且容器名冲突
- 记录 gitea 容器 compose 标签指向的旧路径已不存在, 本文件是幸存副本
- AGENTS.md §3 补 Dockerfile 行 + compose/Dockerfile 对照表, §10 同步
- 顺手订正 §10: kkfile 在 compose 里不是「注释状态」而是完全没有条目

Co-Authored-By: Claude Code <[email protected]>
2026-10-15 14:50:23 +08:00

315 lines
12 KiB
YAML
Raw Permalink 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.
# =============================================================================
# Gitea / PostgreSQL / Redis —— 本机 compose 栈(2026-10-15 订正)
# =============================================================================
# 这个文件曾经是「JNPF + AIBridge + Claude Code 一键启动」的全栈定义。现在:
# - 三个 java 服务(jnpf / workflow / report / xxl)与 nginx 全部服务块已注释,
# 2026-10-15 迁 K8s(见 jnpf-k8s/),**compose 不再跑 JNPF**。
# - 实际在跑的只有下面 3 个:redis / postgres / gitea。
# - 与之配套的 Dockerfile(构建 jnpf-claude 开发镜像)已删 —— compose 里已无任何
# `build:` 段引用它,无容器无镜像,且 §7.1 明令不重打镜像。
#
# ⚠️ 【不要在本目录直接 `docker compose up -d`】—— 会静默起一套空库
# 本文件里所有挂载都是相对路径 `./persist/...`,而 persist/ 是 **testspace 的兄弟
# 目录**,不在本目录内:
# 实际路径 /Users/xs/Desktop/workspace/persist/{gits,postgres}
# 在本目录跑 → 找不到就新建 → 一套没有任何仓库/数据的空 postgres + gitea,
# 且容器名 jnpf-gitea / jnpf-postgres 与现有实例冲突,起不来。
# 正确姿势(现存三个容器的 compose 标签记录的就是这个路径):
# cd /Users/xs/Desktop/workspace && docker compose -f <本文件> up -d
# # 或直接用现有实例:docker exec jnpf-gitea ...
# 查运行态:docker inspect jnpf-gitea \
# --format '{{index .Config.Labels "com.docker.compose.project.working_dir"}}'
#
# 【为什么留这个文件】2026-10-15 清理时差点删掉,三条理由:
# 1. 它是 jnpf-gitea / jnpf-postgres / jnpf-redis **唯一**的完整定义(镜像全名、
# 端口、DB 凭据、healthcheck)。删了就无法在容器被误删后重建 Gitea。
# 2. 注释掉的服务块是 AGENTS.md §1 那几个复用镜像的**出处**
# (ssw188/liberica-openjre-rocky:21、ssw188/nginx:latest)—— K8s 部署全靠
# 「不重打镜像、复用现成镜像」这条硬约束(§7.1),出处没了这条约束就悬空。
# 3. gitea 容器创建于 2026-08-19,其 compose 标签指向的
# /Users/xs/Desktop/workspace/docker-compose.yml **已不存在**,本文件是幸存的副本。
# =============================================================================
services:
# ---------------------------------------------------------------------------
# 基础设施层
# ---------------------------------------------------------------------------
redis:
image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/redis:latest
container_name: jnpf-redis
command: redis-server --requirepass 123456
ports:
- "16379:6379"
networks:
- jnpf-net
restart: unless-stopped
postgres:
image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/postgres:16-alpine
container_name: jnpf-postgres
environment:
POSTGRES_DB: postgres
POSTGRES_USER: dacli
POSTGRES_PASSWORD: dacli123
volumes:
- ./persist/postgres:/var/lib/postgresql/data
ports:
- "15432:5432"
networks:
- jnpf-net
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U dacli -d codegraph"]
interval: 10s
timeout: 5s
retries: 5
# xxl:
# image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/liberica-openjre-rocky:21
# container_name: jnpf-xxl
# depends_on:
# postgres:
# condition: service_healthy
# redis:
# condition: service_started
# ports:
# - "30020:30020"
# volumes:
# - ./persist/xxl:/usr/ssw/xxl
# - ./log:/usr/ssw/log
# command: ["/bin/sh","-c","cd /usr/ssw/xxl; java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar xxl-job-admin-3.5.0-RELEASE.jar"]
# networks:
# - jnpf-net
# restart: unless-stopped
# workflow:
# image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/liberica-openjre-rocky:21
# container_name: jnpf-workflow
# depends_on:
# postgres:
# condition: service_healthy
# redis:
# condition: service_started
# ports:
# - "31000:31000"
# volumes:
# - ./persist/wf:/usr/ssw/wf
# - ./log:/usr/ssw/log
# command: ["/bin/sh","-c","cd /usr/ssw/wf; java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom --add-opens java.base/java.lang=ALL-UNNAMED -XX:+DisableAttachMechanism -jar jnpf-workflow-admin-1.0.0-RELEASE.jar"]
# networks:
# - jnpf-net
# restart: unless-stopped
# ---------------------------------------------------------------------------
# Git 服务(Gitea)
# ---------------------------------------------------------------------------
gitea:
image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/gitea:latest
container_name: jnpf-gitea
depends_on:
postgres:
condition: service_healthy
ports:
- "13300:3000" # Web UI
- "13301:22" # SSH 克隆地址
volumes:
# 数据持久化 - 独立目录,AI 无法访问业务代码
- ./persist/gits:/data
# 时区配置
- /etc/localtime:/etc/localtime:ro
environment:
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=postgres:5432
- GITEA__database__NAME=gitea
- GITEA__database__USER=dacli
- GITEA__database__PASSWD=dacli123
- GITEA__security__INSTALL_LOCK=true
- GITEA__server__DOMAIN=localhost
- GITEA__server__SSH_DOMAIN=localhost
- GITEA__server__HTTP_PORT=3000
- GITEA__server__SSH_PORT=22
- GITEA__server__ROOT_URL=http://localhost:13300/
networks:
- jnpf-net
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000/"]
interval: 15s
timeout: 5s
retries: 5
# ---------------------------------------------------------------------------
# Nginx 前端
# ---------------------------------------------------------------------------
# nginx:
# image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/nginx:latest
# container_name: jnpf-nginx
# depends_on:
# - jnpf
# ports:
# - "13880:80"
# - "13881:81"
# volumes:
# - ./web/apps/jnpf-web-apps-main/dist:/usr/ssw/dist
# - ./web/apps/jnpf-web-apps-main/public:/usr/ssw/public
# - ./persist/resources:/usr/ssw/resources
# - ./persist/datav:/usr/ssw/datav
# - ./persist/nginx.conf:/etc/nginx/conf.d/default.conf
# networks:
# - jnpf-net
# restart: unless-stopped
# healthcheck:
# test: ["CMD", "nginx", "-t"]
# interval: 10s
# timeout: 5s
# retries: 3
# # ---------------------------------------------------------------------------
# # JNPF 主服务(后端 + Claude Code)
# # ---------------------------------------------------------------------------
# jnpf:
# image: crpi-yscq976uwza88qap.cn-shenzhen.personal.cr.aliyuncs.com/ssw188/cc:latest
# # build:
# # context: .
# # dockerfile: Dockerfile
# container_name: jnpf-all-in-one
# depends_on:
# redis:
# condition: service_started
# postgres:
# condition: service_healthy
# xxl:
# condition: service_started
# workflow:
# condition: service_started
# ports:
# # - "30000:30000" # JNPF 后端 API端口
# - "13000:3000" # vite端口
# - "13001:3001" # cloudcli端口
# - "3002:3002" # od web
# - "13088:88" # cloudcli端口
# # - "5005:5005" # JVM 调试
# volumes:
# # JNPF官方包 只读
# - ./jnpf:/home/ubuntu/ccWorkDir/jnpf:ro
# - ./persist/resources:/home/ubuntu/ccWorkDir/boot/resources
# - ./persist/report:/home/ubuntu/ccWorkDir/boot/report
# #映射容器配置信息
# - ./docker-compose.yml:/home/ubuntu/ccWorkDir/docker/docker-compose.yml:ro
# - ./persist/nginx.conf:/home/ubuntu/ccWorkDir/docker/nginx.conf:ro
# - ./Dockerfile:/home/ubuntu/ccWorkDir/docker/Dockerfile:ro
# # 业务代码目录(映射到 /ccWorkDir/)
# - ./dacli:/home/ubuntu/ccWorkDir/dacli
# - ./boot:/home/ubuntu/ccWorkDir/boot
# - ./docs:/home/ubuntu/ccWorkDir/docs
# - ./log:/home/ubuntu/ccWorkDir/log
# - ./web:/home/ubuntu/ccWorkDir/web
# - ./uniapp:/home/ubuntu/ccWorkDir/uniapp
# # Claude Code 环境持久化
# - ./persist/claude:/home/ubuntu/.claude
# - ./persist/claude.json:/home/ubuntu/.claude.json
# # 隐藏目录(项目.claude配置)
# - ./.claude:/home/ubuntu/ccWorkDir/.claude
# #playwright 持久化
# - ./persist/ms-playwright:/home/ubuntu/.cache/ms-playwright
# # Python 环境持久化
# - ./persist/pip:/usr/local/lib/python3.12/dist-packages
# # node / pnpm / pip 下载缓存持久化(对应 Dockerfile 中的缓存路径)
# - ./persist/npm-cache:/home/ubuntu/.cache/npm
# - ./persist/pnpm:/home/ubuntu/.cache/pnpm
# - ./persist/pnpm-store:/home/ubuntu/.cache/pnpm-store
# - ./persist/pip-cache:/home/ubuntu/.cache/pip
# # Maven 环境持久化
# - /root/.m2:/root/.m2
# # Cloudcli
# - ./persist/cloudcli.db:/home/ubuntu/.cloudcli/auth.db
# environment:
# LANG: C.utf8
# LC_ALL: C.utf8
# #DISABLE_AUTOUPDATER: 1 #禁止自动更新
# HOME: /home/ubuntu
# ccWorkDir: /home/ubuntu/ccWorkDir
# working_dir: /home/ubuntu/ccWorkDir
# entrypoint: ["/bin/bash", "-c"]
# #command: ["java -jar boot/jnpf-admin/target/jnpf-admin-*.jar --spring.profiles.active=dev ; tail -f /dev/null"]
# command: ["bash /home/ubuntu/ccWorkDir/.claude/hooks/init.sh && cloudcli &> /tmp/cloudcli.log & java -Dfile.encoding=utf8 -Djava.security.egd=file:/dev/./urandom -jar boot/ssw-admin/target/ssw-admin-*.jar --spring.profiles.active=dev ; tail -f /dev/null"]
# networks:
# - jnpf-net
# restart: unless-stopped
# tty: true
# stdin_open: true
# ontology:
# image: alpine:3.20
# container_name: shangshu-ontology
# depends_on:
# postgres:
# condition: service_healthy
# ports:
# - "8081:8081"
# volumes:
# # 已编译的 Linux 静态二进制 (只读挂载)
# - /Users/xs/Desktop/know/ssw-ontology/bin/server-linux:/app/server:ro
# # 知识文件根目录 (读写, 支持上传提取)
# - /Users/xs/Desktop/know/ssw-ontology/archive:/app/archive
# environment:
# DATABASE_URL: postgres://dacli:dacli123@postgres:5432/shangshu?sslmode=disable
# HTTP_PORT: "8081"
# ARCHIVE_DIR: /app/archive
# SEED_ON_START: "true"
# ALLOW_CORS: "true"
# AI_ENABLED: "true"
# AI_BASE_URL: https://api.minimaxi.com/anthropic
# AI_KEY: sk-cp-pI_Yq-u5HrclWaesyc1R98_yJfUC6c_Mwv7711VQ_p7NeFof96qSLJNlzxsNz0ahi6-LxunFQ5mqkW9exBsyxX-JX9egz9P84edge8j-WMTAXaJVFxEVYRY
# AI_MODEL: MiniMax-M3
# labels:
# - autoheal=true
# networks:
# - jnpf-net
# restart: unless-stopped
# command: ["/bin/sh", "-c", "apk add --no-cache ca-certificates >/dev/null 2>&1; exec /app/server"]
# healthcheck:
# test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:8081/api/v1/connector/object-types || exit 1"]
# interval: 30s
# timeout: 10s
# retries: 3
# start_period: 60s
# autoheal:
# image: willfarrell/autoheal:latest
# environment:
# - AUTOHEAL_CONTAINER_LABEL=autoheal
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# networks:
# - jnpf-net
# restart: unless-stopped
# ---------------------------------------------------------------------------
# 网络与存储
# ---------------------------------------------------------------------------
networks:
jnpf-net:
driver: bridge