chore: keep old selfhost compose file (#9280)
This commit is contained in:
72
.docker/selfhost/compose.yaml
Normal file
72
.docker/selfhost/compose.yaml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
name: affine
|
||||||
|
services:
|
||||||
|
affine:
|
||||||
|
image: ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}
|
||||||
|
container_name: affine_server
|
||||||
|
ports:
|
||||||
|
- '${PORT:-3010}:3010'
|
||||||
|
depends_on:
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
affine_migration:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
volumes:
|
||||||
|
# custom configurations
|
||||||
|
- ${UPLOAD_LOCATION}:/root/.affine/storage
|
||||||
|
- ${CONFIG_LOCATION}:/root/.affine/config
|
||||||
|
env_file:
|
||||||
|
- .env
|
||||||
|
environment:
|
||||||
|
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
affine_migration:
|
||||||
|
image: ghcr.io/toeverything/affine-graphql:${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:
|
||||||
|
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
||||||
|
depends_on:
|
||||||
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
|
redis:
|
||||||
|
image: redis
|
||||||
|
container_name: redis
|
||||||
|
healthcheck:
|
||||||
|
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
postgres:
|
||||||
|
image: postgres:16
|
||||||
|
container_name: postgres
|
||||||
|
volumes:
|
||||||
|
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${DB_USERNAME}
|
||||||
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
|
POSTGRES_DB: ${DB_DATABASE:-affine}
|
||||||
|
POSTGRES_INITDB_ARGS: '--data-checksums'
|
||||||
|
# you better set a password for you database
|
||||||
|
# or you may add 'POSTGRES_HOST_AUTH_METHOD=trust' to ignore postgres security policy
|
||||||
|
POSTGRES_HOST_AUTH_METHOD: trust
|
||||||
|
healthcheck:
|
||||||
|
test:
|
||||||
|
['CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
restart: unless-stopped
|
||||||
79
.github/deployment/self-host/compose.yaml
vendored
79
.github/deployment/self-host/compose.yaml
vendored
@@ -1,71 +1,60 @@
|
|||||||
name: affine
|
|
||||||
services:
|
services:
|
||||||
affine:
|
affine:
|
||||||
image: ghcr.io/toeverything/affine-graphql:${AFFINE_REVISION:-stable}
|
image: ghcr.io/toeverything/affine-graphql:stable
|
||||||
container_name: affine_server
|
container_name: affine_selfhosted
|
||||||
|
command:
|
||||||
|
['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js']
|
||||||
ports:
|
ports:
|
||||||
- '${PORT:-3010}:3010'
|
- '3010:3010'
|
||||||
|
- '5555:5555'
|
||||||
depends_on:
|
depends_on:
|
||||||
redis:
|
redis:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
postgres:
|
postgres:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
affine_migration:
|
|
||||||
condition: service_completed_successfully
|
|
||||||
volumes:
|
volumes:
|
||||||
# custom configurations
|
# custom configurations
|
||||||
- ${UPLOAD_LOCATION}:/root/.affine/storage
|
- ~/.affine/self-host/config:/root/.affine/config
|
||||||
- ${CONFIG_LOCATION}:/root/.affine/config
|
# blob storage
|
||||||
env_file:
|
- ~/.affine/self-host/storage:/root/.affine/storage
|
||||||
- .env
|
logging:
|
||||||
environment:
|
driver: 'json-file'
|
||||||
- NODE_ENV=production
|
options:
|
||||||
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
max-size: '1000m'
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
affine_migration:
|
|
||||||
image: ghcr.io/toeverything/affine-graphql:${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:
|
environment:
|
||||||
- DATABASE_URL=postgresql://${DB_USERNAME}:${DB_PASSWORD}@postgres:5432/${DB_DATABASE:-affine}
|
- NODE_OPTIONS="--import=./scripts/register.js"
|
||||||
depends_on:
|
- AFFINE_CONFIG_PATH=/root/.affine/config
|
||||||
postgres:
|
- REDIS_SERVER_HOST=redis
|
||||||
condition: service_healthy
|
- DATABASE_URL=postgres://affine:affine@postgres:5432/affine
|
||||||
|
- NODE_ENV=production
|
||||||
|
# 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
|
||||||
redis:
|
redis:
|
||||||
image: redis
|
image: redis
|
||||||
container_name: redis
|
container_name: affine_redis
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- ~/.affine/self-host/redis:/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
|
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
restart: unless-stopped
|
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:16
|
image: postgres:16
|
||||||
container_name: postgres
|
container_name: affine_postgres
|
||||||
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- ${DB_DATA_LOCATION}:/var/lib/postgresql/data
|
- ~/.affine/self-host/postgres:/var/lib/postgresql/data
|
||||||
environment:
|
|
||||||
POSTGRES_USER: ${DB_USERNAME}
|
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
||||||
POSTGRES_DB: ${DB_DATABASE:-affine}
|
|
||||||
POSTGRES_INITDB_ARGS: '--data-checksums'
|
|
||||||
# you better set a password for you database
|
|
||||||
# or you may add 'POSTGRES_HOST_AUTH_METHOD=trust' to ignore postgres security policy
|
|
||||||
POSTGRES_HOST_AUTH_METHOD: trust
|
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test:
|
test: ['CMD-SHELL', 'pg_isready -U affine']
|
||||||
['CMD', 'pg_isready', '-U', "${DB_USERNAME}", '-d', "${DB_DATABASE:-affine}"]
|
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
restart: unless-stopped
|
environment:
|
||||||
|
POSTGRES_USER: affine
|
||||||
|
POSTGRES_PASSWORD: affine
|
||||||
|
POSTGRES_DB: affine
|
||||||
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
|
|||||||
4
.github/workflows/release-desktop.yml
vendored
4
.github/workflows/release-desktop.yml
vendored
@@ -437,8 +437,8 @@ jobs:
|
|||||||
node-version: 20
|
node-version: 20
|
||||||
- name: Copy Selfhost Release Files
|
- name: Copy Selfhost Release Files
|
||||||
run: |
|
run: |
|
||||||
cp ./.github/deployment/self-host/compose.yaml ./release/docker-compose.yaml
|
cp ./.docker/selfhost/compose.yaml ./release/docker-compose.yaml
|
||||||
cp ./.github/deployment/self-host/.env.example ./release/.env.example
|
cp ./.docker/selfhost/.env.example ./release/.env.example
|
||||||
- name: Generate Release yml
|
- name: Generate Release yml
|
||||||
run: |
|
run: |
|
||||||
node ./scripts/generate-release-yml.mjs
|
node ./scripts/generate-release-yml.mjs
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
.github
|
.github
|
||||||
.vscode
|
.vscode
|
||||||
.yarnrc.yml
|
.yarnrc.yml
|
||||||
|
.docker
|
||||||
|
|
||||||
# compiled output
|
# compiled output
|
||||||
.coverage
|
.coverage
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
".github",
|
".github",
|
||||||
".vscode",
|
".vscode",
|
||||||
".yarnrc.yml",
|
".yarnrc.yml",
|
||||||
|
".docker",
|
||||||
".coverage",
|
".coverage",
|
||||||
".nx/**",
|
".nx/**",
|
||||||
"target",
|
"target",
|
||||||
|
|||||||
Reference in New Issue
Block a user