文件
hyb-oa/deploy/trialrun/docker-compose.yml
T
wangsli b87cc55aca
ci-e2e / e2e (push) Canceled after 0s
ci-minimal / check-minimal (push) Canceled after 0s
fix: 分离日常发布与首次初始化(09-09-existing-deploy-seed-separation)
2026-09-09 12:47:30 +08:00

115 行
3.2 KiB
YAML

version: "3.8"
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- ${POSTGRES_DATA_DIR:-./data/postgres}:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 10
minio:
image: minio/minio:RELEASE.2025-01-20T14-49-07Z
restart: unless-stopped
profiles: ["minio"]
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
command: ["server", "/data", "--console-address", ":9001"]
ports:
- "9000:9000"
- "9001:9001"
volumes:
- ./data/minio:/data
minio_init:
image: minio/mc:RELEASE.2025-08-13T08-35-41Z
profiles: ["minio"]
depends_on:
- minio
env_file:
- ./.env
entrypoint: ["sh", "-c"]
command: |
set -e
for i in $$(seq 1 60); do
mc alias set local http://minio:9000 "$$MINIO_ROOT_USER" "$$MINIO_ROOT_PASSWORD" && break || true
sleep 1
done
mc mb --ignore-existing "local/$$S3_BUCKET"
server:
build:
context: ../..
dockerfile: deploy/trialrun/Dockerfile
args:
BUILD_SHA: ${BUILD_SHA:?set BUILD_SHA to the approved full commit}
VITE_BUILD_SHA: ${VITE_BUILD_SHA:?set VITE_BUILD_SHA to the matching short commit}
restart: unless-stopped
depends_on:
db:
condition: service_healthy
env_file:
- ./.env
environment:
NODE_ENV: production
BUILD_SHA: ${BUILD_SHA:?set BUILD_SHA to the approved full commit}
ports:
- "127.0.0.1:${APP_HOST_PORT:-3000}:3000"
volumes:
- ${STORAGE_HOST_DIR:-./data/storage}:${STORAGE_DIR}
worker:
build:
context: ../..
dockerfile: deploy/trialrun/Dockerfile
args:
BUILD_SHA: ${BUILD_SHA:?set BUILD_SHA to the approved full commit}
VITE_BUILD_SHA: ${VITE_BUILD_SHA:?set VITE_BUILD_SHA to the matching short commit}
restart: unless-stopped
profiles: ["worker"]
depends_on:
db:
condition: service_healthy
env_file:
- ./.env
command: ["npm", "run", "worker"]
environment:
NODE_ENV: production
BUILD_SHA: ${BUILD_SHA:?set BUILD_SHA to the approved full commit}
SERVE_CLIENT_DIST: "false"
JOBS_ENABLED: "true"
volumes:
- ${STORAGE_HOST_DIR:-./data/storage}:${STORAGE_DIR}
init:
build:
context: ../..
dockerfile: deploy/trialrun/Dockerfile
args:
BUILD_SHA: ${BUILD_SHA:?set BUILD_SHA to the approved full commit}
VITE_BUILD_SHA: ${VITE_BUILD_SHA:?set VITE_BUILD_SHA to the matching short commit}
depends_on:
db:
condition: service_healthy
env_file:
- ./.env
environment:
NODE_ENV: production
DEPLOY_DATA_MODE: ${DEPLOY_DATA_MODE:-}
BUILD_SHA: ${BUILD_SHA:?set BUILD_SHA to the approved full commit}
volumes:
- ${STORAGE_HOST_DIR:-./data/storage}:${STORAGE_DIR}
entrypoint: ["sh", "-c"]
command:
- cd /app/server && npm run deploy:init
restart: "no"