compose.deploy.yaml
此代码来自构建时的仓库快照。修改源码后重新构建即可更新。
name: teamdesk-deploy
x-app-env: &app-env
DATABASE_URL: postgresql://teamdesk:${POSTGRES_PASSWORD:?请设置数据库密码}@postgres:5432/teamdesk
REDIS_URL: redis://:${REDIS_PASSWORD:?请设置Redis密码}@redis:6379
QUEUE_PREFIX: ${QUEUE_PREFIX:-teamdesk-production}
BETTER_AUTH_URL: ${BETTER_AUTH_URL:?请设置站点URL}
BETTER_AUTH_SECRET: ${BETTER_AUTH_SECRET:?请设置登录密钥}
LOG_LEVEL: ${LOG_LEVEL:-info}
x-logging: &logging
driver: json-file
options:
max-size: '10m'
max-file: '3'
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_USER: teamdesk
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?请设置数据库密码}
POSTGRES_DB: teamdesk
volumes:
- postgres:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U teamdesk -d teamdesk']
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
logging: *logging
redis:
image: redis:7-alpine
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:?请设置Redis密码}
command:
[
'sh',
'-c',
'exec redis-server --appendonly yes --maxmemory-policy noeviction --requirepass "$$REDIS_PASSWORD"',
]
volumes:
- redis:/data
healthcheck:
test:
[
'CMD-SHELL',
'REDISCLI_AUTH="$$REDIS_PASSWORD" redis-cli ping | grep -q PONG',
]
interval: 5s
timeout: 3s
retries: 20
restart: unless-stopped
logging: *logging
migrate:
build:
context: .
target: migrate
environment: *app-env
depends_on:
postgres:
condition: service_healthy
restart: 'no'
logging: *logging
web:
build:
context: .
target: web
environment: *app-env
ports:
- '127.0.0.1:${WEB_PORT:-3000}:3000'
depends_on:
migrate:
condition: service_completed_successfully
restart: unless-stopped
init: true
logging: *logging
worker:
build:
context: .
target: worker
environment: *app-env
depends_on:
migrate:
condition: service_completed_successfully
redis:
condition: service_healthy
restart: unless-stopped
init: true
stop_grace_period: 90s
logging: *logging
volumes:
postgres:
redis: