Files
templates/blueprints/affinepro/docker-compose.yml
Mauricio Siu 59770d4ae8 fix(affinepro): update to current AFFiNE images
The template pinned ghcr.io/toeverything/affine-graphql:stable-780dd83,
an ephemeral per-commit tag on the old image name that has since been
removed from GHCR, so the template could no longer pull and deploy.

- Switch both app and migration services to ghcr.io/toeverything/affine:stable,
  the rolling stable tag recommended by the official self-host compose,
  so the template no longer rots when per-commit tags are garbage-collected
- Move postgres to pgvector/pgvector:pg16 and set AFFINE_INDEXER_ENABLED=false,
  matching the current upstream self-host compose requirements
- Add postgres/redis healthchecks and proper depends_on conditions so the
  self-host-predeploy migration job runs only once the database is ready,
  and the server starts only after migrations complete successfully

Closes #777

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 10:55:42 -06:00

85 lines
2.4 KiB
YAML

version: "3.8"
services:
affinepro:
image: ghcr.io/toeverything/affine:stable
restart: unless-stopped
ports:
- 3010
volumes:
- affine-storage:/root/.affine/storage
- affine-config:/root/.affine/config
environment:
- REDIS_SERVER_HOST=redis
- REDIS_SERVER_PASSWORD=${REDIS_PASSWORD}
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/affinepro
- AFFINE_INDEXER_ENABLED=false
- AFFINE_SERVER_HOST=${DOMAIN}
- MAILER_HOST=${MAILER_HOST}
- MAILER_PORT=${MAILER_PORT}
- MAILER_USER=${MAILER_USER}
- MAILER_PASSWORD=${MAILER_PASSWORD}
- MAILER_SENDER=${MAILER_SENDER}
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
migration:
condition: service_completed_successfully
migration:
image: ghcr.io/toeverything/affine:stable
command: ["sh", "-c", "node ./scripts/self-host-predeploy.js"]
environment:
- REDIS_SERVER_HOST=redis
- REDIS_SERVER_PASSWORD=${REDIS_PASSWORD}
- DATABASE_URL=postgresql://postgres:${POSTGRES_PASSWORD}@db:5432/affinepro
- AFFINE_INDEXER_ENABLED=false
- AFFINE_SERVER_HOST=${DOMAIN}
- MAILER_HOST=${MAILER_HOST}
- MAILER_PORT=${MAILER_PORT}
- MAILER_USER=${MAILER_USER}
- MAILER_PASSWORD=${MAILER_PASSWORD}
- MAILER_SENDER=${MAILER_SENDER}
volumes:
- affine-storage:/root/.affine/storage
- affine-config:/root/.affine/config
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
db:
image: pgvector/pgvector:pg16
restart: unless-stopped
environment:
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=affinepro
- POSTGRES_INITDB_ARGS=--data-checksums
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "postgres", "-d", "affinepro"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --requirepass ${REDIS_PASSWORD}
volumes:
- redis-data:/data
healthcheck:
test: ["CMD-SHELL", "redis-cli -a '${REDIS_PASSWORD}' ping | grep PONG"]
interval: 10s
timeout: 5s
retries: 5
volumes:
affine-storage: {}
affine-config: {}
postgres-data: {}
redis-data: {}