fix(service): update service template for affine and add migration service for improved deployment process

This commit is contained in:
Andras Bacsai
2025-06-13 15:25:45 +02:00
parent f72567fc2d
commit ac66e857c9
2 changed files with 19 additions and 6 deletions

View File

@@ -7,10 +7,6 @@
services:
affine:
image: ghcr.io/toeverything/affine-graphql:stable
command:
- sh
- '-c'
- 'node ./scripts/self-host-predeploy && node ./dist/index.js'
depends_on:
redis:
condition: service_healthy
@@ -25,7 +21,6 @@ services:
max-size: 1000m
environment:
- SERVICE_FQDN_AFFINE_3010
- NODE_OPTIONS=--import=./scripts/register.js
- AFFINE_CONFIG_PATH=/root/.affine/config
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-affine}
@@ -46,6 +41,24 @@ services:
timeout: 20s
retries: 3
affine_migration:
exclude_from_hc: true
image: ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}
restart: on-failure
volumes:
- affine-storage:/root/.affine/storage
- affine-config:/root/.affine/config
command: ['sh', '-c', 'node ./scripts/self-host-predeploy.js']
environment:
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-affine}
- AFFINE_INDEXER_ENABLED=false
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
redis:
image: redis
volumes: