-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
136 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
captainVersion: 4 | ||
services: | ||
#affine: | ||
$$cap_appname: | ||
image: ghcr.io/toeverything/affine-graphql:$$cap_affine_version | ||
command: | ||
['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js'] | ||
ports: | ||
- '3010:3010' | ||
- '5555:5555' | ||
depends_on: | ||
$$cap_appname-redis: | ||
condition: service_healthy | ||
$$cap_appname-postgres: | ||
condition: service_healthy | ||
volumes: | ||
# custom configurations | ||
- $$cap_appname-db-data:/root/.affine/config | ||
# blob storage | ||
- $$cap_appname-db-data:/root/.affine/storage | ||
logging: | ||
driver: 'json-file' | ||
options: | ||
max-size: '1000m' | ||
restart: unless-stopped | ||
environment: | ||
NODE_OPTIONS: "--import=./scripts/register.js" | ||
AFFINE_CONFIG_PATH: /root/.affine/config | ||
REDIS_SERVER_HOST: srv-captain--$$cap_appname_data-redis | ||
DATABASE_URL: postgres://affine:$$cap_db_affine_password@srv-captain--$$cap_appname-postgres:5432/affine | ||
NODE_ENV: production | ||
AFFINE_ADMIN_EMAIL: $$cap_affine_admin_email | ||
AFFINE_ADMIN_PASSWORD: $$cap_affine_admin_password | ||
AFFINE_SERVER_HOST: $$cap_affine_server_host | ||
AFFINE_SERVER_PORT: $$cap_affine_server_port | ||
AFFINE_SERVER_HTTPS: $$cap_affine_server_https | ||
AFFINE_SERVER_EXTERNAL_URL: $$cap_affine_server_external_url | ||
MAILER_HOST: $$cap_mailer_host | ||
MAILER_PORT: $$cap_mailer_port | ||
MAILER_USER: $$cap_mailer_user | ||
MAILER_PASSWORD: $$cap_mailer_password | ||
MAILER_SENDER: $$cap_mailer_sender | ||
# Telemetry allows us to collect data on how you use the affine. This data will helps us improve the app and provide better features. | ||
# Uncomment next line if you wish to quit telemetry. | ||
# - TELEMETRY_ENABLE=false | ||
$$cap_appname-redis: | ||
image: redis | ||
restart: unless-stopped | ||
volumes: | ||
- $$cap_appname-db-data:/data | ||
healthcheck: | ||
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping'] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
$$cap_appname-postgres: | ||
image: postgres | ||
restart: unless-stopped | ||
volumes: | ||
- $$cap_appname-db-data:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ['CMD-SHELL', 'pg_isready -U affine'] | ||
interval: 10s | ||
timeout: 5s | ||
retries: 5 | ||
environment: | ||
POSTGRES_DB: affine | ||
POSTGRES_USER: affine | ||
POSTGRES_PASSWORD: $$cap_db_affine_password | ||
PGDATA: /var/lib/postgresql/data/pgdata | ||
caproverOneClickApp: | ||
variables: | ||
- defaultValue: stable | ||
description: Check out their Docker page for the valid tags https://github.com/toeverything/AFFiNE/pkgs/container/affine-graphql | ||
id: $$cap_affine_version | ||
label: Affine version | ||
validRegex: /^([^\s^\/])+$/ | ||
|
||
- description: Default access domain of AFFiNE. Make sure this matches the URL in browser. localhost | ||
id: $$cap_affine_server_host | ||
label: AFFINE_SERVER_HOST | ||
|
||
- defaultValue: 3010 | ||
description: Default access port of AFFiNE. Make sure this matches the URL in browser. 3010 | ||
id: $$cap_affine_server_port | ||
label: AFFINE_SERVER_PORT | ||
|
||
- description: Use https prefix in url. - Make sure this matches the URL in browser. false | ||
id: $$cap_affine_server_https | ||
label: AFFINE_SERVER_HTTPS | ||
|
||
- description: Used to factor url to server resources (default to [protocol]://[host][:port]) | ||
id: $$cap_affine_server_external_url | ||
label: AFFINE_SERVER_EXTERNAL_URL | ||
|
||
- description: Email server domain | ||
id: $$cap_mailer_host | ||
label: MAILER_HOST | ||
|
||
- description: Email server port | ||
id: $$cap_mailer_port | ||
label: MAILER_PORT | ||
|
||
- description: Email login user | ||
id: $$cap_mailer_user | ||
label: MAILER_USER | ||
|
||
- description: Email password | ||
id: $$cap_mailer_password | ||
label: MAILER_PASSWORD | ||
|
||
- description: Email sender (not avaliable for consumer mail service like gmail/outlook) | ||
id: $$cap_mailer_sender | ||
label: MAILER_SENDER | ||
|
||
- defaultValue: $$cap_gen_random_hex(32) | ||
description: Database password of the affine user. | ||
id: $$cap_db_affine_password | ||
label: 'Database password' | ||
validRegex: /^(?=.*\d).{10,}$/ | ||
|
||
instructions: | ||
start: Affine - There can be more than Notion and Miro. AFFiNE(pronounced [ə'fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use. | ||
end: >- | ||
🎉 It's done! Affine is deployed and available as $$cap_appname. 🎉 | ||
Please enable HTTPS before starting using Affine. | ||
Your service is available at http://$$cap_appname.$$cap_root_domain | ||
Go there to create your admin account | ||
IMPORTANT: It will take up to 2 minutes for Docmost to be ready. Before that, you might see 502 error page. | ||
displayName: 'Affine' | ||
isOfficial: false | ||
description: Affine - There can be more than Notion and Miro. AFFiNE(pronounced [ə'fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use. | ||
documentation: https://docs.affine.pro/docs/code-of-conduct |