81c199b
# 本地开发依赖服务(macOS / Linux)。
# 与 config/local/ 的默认端口一一对应:
# PostgreSQL 5432 / Redis 6379 / S3(RustFS) 9000
# 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
# 本地 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: