From 57e646a91ef08a874aaa7bc4f4774bba5253c8ed Mon Sep 17 00:00:00 2001 From: Osama Riaz Date: Sun, 6 Oct 2024 03:00:56 +0500 Subject: [PATCH] feat: affine service template and logo --- public/svgs/affine.svg | 88 +++++++++++++++++++++++++++++++++++ templates/compose/affine.yaml | 71 ++++++++++++++++++++++++++++ 2 files changed, 159 insertions(+) create mode 100644 public/svgs/affine.svg create mode 100644 templates/compose/affine.yaml diff --git a/public/svgs/affine.svg b/public/svgs/affine.svg new file mode 100644 index 000000000..d8063e920 --- /dev/null +++ b/public/svgs/affine.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/templates/compose/affine.yaml b/templates/compose/affine.yaml new file mode 100644 index 000000000..c863b8031 --- /dev/null +++ b/templates/compose/affine.yaml @@ -0,0 +1,71 @@ +# documentation: https://docs.affine.pro/docs/self-host-affine +# 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 +# logo: svgs/affine.svg + +services: + affine: + image: 'ghcr.io/toeverything/affine-graphql:stable' + command: + - sh + - '-c' + - 'node ./scripts/self-host-predeploy && node ./dist/index.js' + ports: + - ':3010' + - ':5555' + depends_on: + redis: + condition: service_healthy + postgres: + condition: service_healthy + volumes: + - '~/.affine/self-host/config:/root/.affine/config' + - '~/.affine/self-host/storage:/root/.affine/storage' + logging: + driver: json-file + options: + max-size: 1000m + environment: + - SERVICE_FQDN_AFFINE + - '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}' + - NODE_ENV=production + - AFFINE_SERVER_HOST=$SERVICE_FQDN_AFFINE + - AFFINE_SERVER_EXTERNAL_URL=$SERVICE_FQDN_AFFINE + - MAILER_HOST=$MAILER_HOST + - MAILER_PORT=$MAILER_PORT + - MAILER_USER=$MAILER_USER + - MAILER_PASSWORD=$MAILER_PASSWORD + - MAILER_SENDER=$MAILER_SENDER + redis: + image: redis + volumes: + - '~/.affine/self-host/redis:/data' + healthcheck: + test: + - CMD + - redis-cli + - '--raw' + - incr + - ping + interval: 10s + timeout: 5s + retries: 5 + postgres: + image: postgres + volumes: + - '~/.affine/self-host/postgres:/var/lib/postgresql/data' + healthcheck: + test: + - CMD-SHELL + - 'pg_isready -U affine' + interval: 10s + timeout: 5s + retries: 5 + environment: + - POSTGRES_USER=$SERVICE_USER_POSTGRES + - POSTGRES_PASSWORD=$SERVICE_PASSWORD_POSTGRES + - 'POSTGRES_DB=${POSTGRES_DB:-affine}' + - PGDATA=/var/lib/postgresql/data/pgdata