fix affine

This commit is contained in:
peaklabs-dev
2024-10-09 23:25:53 +02:00
parent 5946e8c33c
commit 5ab347da76

View File

@@ -2,47 +2,53 @@
# slogan: AFFiNE is an open-source, all-in-one workspace and OS for knowledge management, a Notion/Miro alternative. # slogan: AFFiNE is an open-source, all-in-one workspace and OS for knowledge management, a Notion/Miro alternative.
# tags: knowledge-management,notion,miro,workspace # tags: knowledge-management,notion,miro,workspace
# logo: svgs/affine.svg # logo: svgs/affine.svg
# port: 3010
services: services:
affine: affine:
image: 'ghcr.io/toeverything/affine-graphql:stable' image: ghcr.io/toeverything/affine-graphql:stable
command: command:
- sh - sh
- '-c' - '-c'
- 'node ./scripts/self-host-predeploy && node ./dist/index.js' - 'node ./scripts/self-host-predeploy && node ./dist/index.js'
ports: ports:
- ':3010' - ${AFFINE_PORT:-55555}:5555
- ':5555'
depends_on: depends_on:
redis: redis:
condition: service_healthy condition: service_healthy
postgres: postgres:
condition: service_healthy condition: service_healthy
volumes: volumes:
- '~/.affine/self-host/config:/root/.affine/config' - affine-config:/root/.affine/config
- '~/.affine/self-host/storage:/root/.affine/storage' - affine-storage:/root/.affine/storage
logging: logging:
driver: json-file driver: json-file
options: options:
max-size: 1000m max-size: 1000m
environment: environment:
- SERVICE_FQDN_AFFINE - SERVICE_FQDN_AFFINE_3010
- 'NODE_OPTIONS="--import=./scripts/register.js"' - NODE_OPTIONS=--import=./scripts/register.js
- AFFINE_CONFIG_PATH=/root/.affine/config - AFFINE_CONFIG_PATH=/root/.affine/config
- REDIS_SERVER_HOST=redis - REDIS_SERVER_HOST=redis
- 'DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-affine}' - DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-affine}
- NODE_ENV=production - NODE_ENV=production
- AFFINE_SERVER_HOST=$SERVICE_FQDN_AFFINE - AFFINE_SERVER_HOST=$SERVICE_FQDN_AFFINE
- AFFINE_SERVER_EXTERNAL_URL=$SERVICE_FQDN_AFFINE - AFFINE_SERVER_EXTERNAL_URL=$SERVICE_FQDN_AFFINE
- MAILER_HOST=$MAILER_HOST - MAILER_HOST=${MAILER_HOST}
- MAILER_PORT=$MAILER_PORT - MAILER_PORT=${MAILER_PORT}
- MAILER_USER=$MAILER_USER - MAILER_USER=${MAILER_USER}
- MAILER_PASSWORD=$MAILER_PASSWORD - MAILER_PASSWORD=${MAILER_PASSWORD}
- MAILER_SENDER=$MAILER_SENDER - MAILER_SENDER=${MAILER_SENDER}
healthcheck:
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/3010' || exit 1"]
interval: 5s
timeout: 20s
retries: 3
redis: redis:
image: redis image: redis
volumes: volumes:
- '~/.affine/self-host/redis:/data' - affine-redis-data:/data
healthcheck: healthcheck:
test: test:
- CMD - CMD
@@ -54,9 +60,9 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
postgres: postgres:
image: postgres image: postgres:16
volumes: volumes:
- '~/.affine/self-host/postgres:/var/lib/postgresql/data' - affine-postgres-data:/var/lib/postgresql/data
healthcheck: healthcheck:
test: test:
- CMD-SHELL - CMD-SHELL
@@ -65,7 +71,7 @@ services:
timeout: 5s timeout: 5s
retries: 5 retries: 5
environment: environment:
- POSTGRES_USER=$SERVICE_USER_POSTGRES - POSTGRES_USER=${SERVICE_USER_POSTGRES}
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES - POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
- 'POSTGRES_DB=${POSTGRES_DB:-affine}' - POSTGRES_DB=${POSTGRES_DB:-affine}
- PGDATA=/var/lib/postgresql/data/pgdata - PGDATA=/var/lib/postgresql/data/pgdata