Actualiser affine.yaml

This commit is contained in:
2025-09-30 20:42:47 +02:00
parent ff5d8d93f2
commit a5ecdede91

View File

@@ -1,60 +1,76 @@
name: affine
services: services:
postgres: affine:
image: pgvector/pgvector:pg17 image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable}
container_name: affine_db container_name: affine_server_1
environment: ports:
POSTGRES_USER: ${POSTGRES_USER} - '${PORT:-3010}:3010'
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} depends_on:
POSTGRES_DB: ${POSTGRES_DB} redis:
condition: service_healthy
postgres:
condition: service_healthy
affine_migration:
condition: service_completed_successfully
volumes: volumes:
- affine_db_data:/var/lib/postgresql/data # custom configurations
- ${UPLOAD_LOCATION}:/root/.affine/storage
- ${CONFIG_LOCATION}:/root/.affine/config
#env_file:
# - .env
environment:
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
- AFFINE_INDEXER_ENABLED=false
restart: unless-stopped restart: unless-stopped
affine_migration:
image: ghcr.io/toeverything/affine:${AFFINE_REVISION:-stable}
container_name: affine_migration_job
volumes:
# custom configurations
- ${UPLOAD_LOCATION}:/root/.affine/storage
- ${CONFIG_LOCATION}:/root/.affine/config
command: ['sh', '-c', 'node ./scripts/self-host-predeploy.js']
# env_file:
# - .env
environment:
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
- AFFINE_INDEXER_ENABLED=false
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
redis: redis:
image: redis:latest image: redis
container_name: affine_redis container_name: affine_redis_1
volumes: healthcheck:
- affine_redis_data:/data test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped restart: unless-stopped
affine: postgres:
image: ghcr.io/toeverything/affine:canary image: pgvector/pgvector:pg16
container_name: affine_app container_name: affine_postgres
depends_on:
- postgres
- redis
ports:
- "${AFFINE_PORT:-3010}:3010"
volumes: volumes:
- affine_config:/root/.affine/config - ${DB_DATA_LOCATION}:/var/lib/postgresql/data
- affine_storage:/root/.affine/storage
environment: environment:
# Config AFFiNE POSTGRES_USER: ${DB_USERNAME}
AFFINE_REVISION: ${AFFINE_REVISION:-canary} POSTGRES_PASSWORD: ${DB_PASSWORD}
AFFINE_INDEXER_ENABLED: ${AFFINE_INDEXER_ENABLED:-false} POSTGRES_DB: ${DB_DATABASE:-affine}
PORT: 3010 POSTGRES_INITDB_ARGS: '--data-checksums'
AFFINE_SERVER_HTTPS: ${AFFINE_SERVER_HTTPS:-true} # you better set a password for you database
AFFINE_SERVER_EXTERNAL_URL: ${AFFINE_EXTERNAL_URL} # or you may add 'POSTGRES_HOST_AUTH_METHOD=trust' to ignore postgres security policy
AFFINE_DISABLE_DEMO_WORKSPACE: true POSTGRES_HOST_AUTH_METHOD: trust
healthcheck:
test:
# SMTP / Mailer ['CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"]
MAILER_HOST: ${MAILER_HOST} interval: 10s
MAILER_PORT: ${MAILER_PORT} timeout: 5s
MAILER_USER: ${MAILER_USER} retries: 5
MAILER_PASSWORD: ${MAILER_PASSWORD}
MAILER_SENDER: ${MAILER_SENDER}
# Backend
REDIS_SERVER_HOST: redis
DATABASE_URL: ${DATABASE_URL}
NODE_ENV: production
AFFINE_ADMIN_EMAIL: ${AFFINE_ADMIN_EMAIL}
AFFINE_ADMIN_PASSWORD: ${AFFINE_ADMIN_PASSWORD}
restart: unless-stopped restart: unless-stopped
volumes:
affine_db_data:
affine_redis_data:
affine_config:
affine_storage: