# 本地开发依赖服务(macOS / Linux)。 # 与 config/local.toml 的默认端口一一对应: # PostgreSQL 5432 / Redis 6379 / S3(RustFS) 9000 / Meilisearch 7700 # 用法: # 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 meilisearch: image: getmeili/meilisearch:v1.13 container_name: gitdata-dev-meilisearch restart: unless-stopped environment: MEILI_MASTER_KEY: 48e6813b44ed0de5d7272e06967703fb MEILI_ENV: development MEILI_NO_ANALYTICS: "true" ports: - "127.0.0.1:7700:7700" volumes: - meili-data:/meili_data healthcheck: test: ["CMD-SHELL", "curl -fsS http://127.0.0.1:7700/health >/dev/null || exit 1"] interval: 5s timeout: 3s retries: 20 # 本地 S3 bucket 初始化(建出 config/local.toml 里声明的 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: meili-data: