Skip to content

Commit 5ab347d

Browse files
committed
fix affine
1 parent 5946e8c commit 5ab347d

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

templates/compose/affine.yaml

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,53 @@
22
# slogan: AFFiNE is an open-source, all-in-one workspace and OS for knowledge management, a Notion/Miro alternative.
33
# tags: knowledge-management,notion,miro,workspace
44
# logo: svgs/affine.svg
5+
# port: 3010
56

67
services:
78
affine:
8-
image: 'ghcr.io/toeverything/affine-graphql:stable'
9+
image: ghcr.io/toeverything/affine-graphql:stable
910
command:
1011
- sh
1112
- '-c'
1213
- 'node ./scripts/self-host-predeploy && node ./dist/index.js'
1314
ports:
14-
- ':3010'
15-
- ':5555'
15+
- ${AFFINE_PORT:-55555}:5555
1616
depends_on:
1717
redis:
18-
condition: service_healthy
18+
condition: service_healthy
1919
postgres:
2020
condition: service_healthy
2121
volumes:
22-
- '~/.affine/self-host/config:/root/.affine/config'
23-
- '~/.affine/self-host/storage:/root/.affine/storage'
22+
- affine-config:/root/.affine/config
23+
- affine-storage:/root/.affine/storage
2424
logging:
2525
driver: json-file
2626
options:
2727
max-size: 1000m
2828
environment:
29-
- SERVICE_FQDN_AFFINE
30-
- 'NODE_OPTIONS="--import=./scripts/register.js"'
29+
- SERVICE_FQDN_AFFINE_3010
30+
- NODE_OPTIONS=--import=./scripts/register.js
3131
- AFFINE_CONFIG_PATH=/root/.affine/config
3232
- REDIS_SERVER_HOST=redis
33-
- 'DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-affine}'
33+
- DATABASE_URL=postgres://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@postgres:5432/${POSTGRES_DB:-affine}
3434
- NODE_ENV=production
3535
- AFFINE_SERVER_HOST=$SERVICE_FQDN_AFFINE
3636
- AFFINE_SERVER_EXTERNAL_URL=$SERVICE_FQDN_AFFINE
37-
- MAILER_HOST=$MAILER_HOST
38-
- MAILER_PORT=$MAILER_PORT
39-
- MAILER_USER=$MAILER_USER
40-
- MAILER_PASSWORD=$MAILER_PASSWORD
41-
- MAILER_SENDER=$MAILER_SENDER
37+
- MAILER_HOST=${MAILER_HOST}
38+
- MAILER_PORT=${MAILER_PORT}
39+
- MAILER_USER=${MAILER_USER}
40+
- MAILER_PASSWORD=${MAILER_PASSWORD}
41+
- MAILER_SENDER=${MAILER_SENDER}
42+
healthcheck:
43+
test: ["CMD-SHELL", "bash -c ':> /dev/tcp/127.0.0.1/3010' || exit 1"]
44+
interval: 5s
45+
timeout: 20s
46+
retries: 3
47+
4248
redis:
4349
image: redis
4450
volumes:
45-
- '~/.affine/self-host/redis:/data'
51+
- affine-redis-data:/data
4652
healthcheck:
4753
test:
4854
- CMD
@@ -54,9 +60,9 @@ services:
5460
timeout: 5s
5561
retries: 5
5662
postgres:
57-
image: postgres
63+
image: postgres:16
5864
volumes:
59-
- '~/.affine/self-host/postgres:/var/lib/postgresql/data'
65+
- affine-postgres-data:/var/lib/postgresql/data
6066
healthcheck:
6167
test:
6268
- CMD-SHELL
@@ -65,7 +71,7 @@ services:
6571
timeout: 5s
6672
retries: 5
6773
environment:
68-
- POSTGRES_USER=$SERVICE_USER_POSTGRES
69-
- POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES
70-
- 'POSTGRES_DB=${POSTGRES_DB:-affine}'
74+
- POSTGRES_USER=${SERVICE_USER_POSTGRES}
75+
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRES}
76+
- POSTGRES_DB=${POSTGRES_DB:-affine}
7177
- PGDATA=/var/lib/postgresql/data/pgdata

0 commit comments

Comments
 (0)