327df0c
# 本地开发依赖服务(macOS / Linux)。
# 与 config/local/ 的默认端口一一对应:
# PostgreSQL 5432 / Redis 6379 / S3(RustFS) 9000 / LiveKit 7880(7881/7882)
# RocketMQ 是 KenApi 的启动必需项,由宿主机提供:
# config/local/rocketmq.json 覆盖为 127.0.0.1:6876,未建 local 时用
# config/default/rocketmq.json 的 127.0.0.1:9876。
# 本 compose 不启动 MQ,启动 KenApi 前请先确认 nameserver 可达。
# 用法:
# just infra 启动
# just infra-down 停止
# 仅用于本地开发,账号密码均为固定值,请勿用于任何对外环境。
name: gitdata-dev
services:
postgres:
image: postgres:16-alpine
container_name: gitdata-dev-postgres
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: gitdata
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d gitdata"]
interval: 5s
timeout: 3s
retries: 20
redis:
image: redis:7-alpine
container_name: gitdata-dev-redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "no", "--save", ""]
ports:
- "127.0.0.1:6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 20
# S3 兼容对象存储:RustFS
rustfs:
image: rustfs/rustfs:latest
container_name: gitdata-dev-rustfs
restart: unless-stopped
environment:
RUSTFS_ADDRESS: ":9000"
RUSTFS_CONSOLE_ENABLE: "true"
RUSTFS_CONSOLE_ADDRESS: ":9001"
RUSTFS_ACCESS_KEY: rustfsadmin
RUSTFS_SECRET_KEY: rustfsadmin
RUSTFS_VOLUMES: /data
ports:
- "127.0.0.1:9000:9000"
- "127.0.0.1:9001:9001"
volumes:
- rustfs-data:/data
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:9000/ >/dev/null || exit 1"]
interval: 5s
timeout: 3s
retries: 20
# 语音/视频房间服务(config/local/livekit.json 指向 127.0.0.1:7880)。
# 用 host 网络:LiveKit 既要读宿主机 Redis(127.0.0.1:6379),又要 webhook 回调
# 宿主机 apihost(127.0.0.1:7051/api/v1/chat/livekit/webhook),host 网络省掉
# 服务名解析与端口映射。配置见 deploy/livekit/livekit.yaml,key/secret 与
# config/local/livekit.json 一致。
# 注意:host 网络只在 Linux 生效;macOS/Windows 需改桥接并设 rtc.node_ip。
livekit:
image: ${LIVEKIT_IMAGE:-docker.m.daocloud.io/livekit/livekit-server:v1.9.1}
container_name: gitdata-dev-livekit
restart: unless-stopped
network_mode: host
command: ["--config", "/etc/livekit/livekit.yaml"]
volumes:
- ./deploy/livekit/livekit.yaml:/etc/livekit/livekit.yaml:ro
logging:
driver: json-file
options:
max-size: "20m"
max-file: "3"
# 本地 S3 bucket 初始化(建出 config/local/s3.json 里声明的 bucket)
minio-init:
image: minio/mc:latest
container_name: gitdata-dev-bucket-init
depends_on:
rustfs:
condition: service_started
entrypoint: ["/bin/sh", "-c"]
command:
- |
until mc alias set local http://rustfs:9000 rustfsadmin rustfsadmin >/dev/null 2>&1; do sleep 1; done
mc mb --ignore-existing local/gitdata
echo "bucket ready: gitdata"
volumes:
postgres-data:
rustfs-data: