chore: fix startup procedure for self hosting

This commit is contained in:
Karol Sójko 2023-02-08 11:02:05 +01:00
parent 85a87dc40a
commit 8a79437668
No known key found for this signature in database
GPG key ID: A50543BF560BDEB0
2 changed files with 40 additions and 47 deletions

View file

@ -2,33 +2,9 @@
nodaemon=true
logfile=/tmp/supervisord.log
[program:api-gateway]
directory=/opt/server
command=yarn start:api-gateway
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/api-gateway.log
stderr_logfile=/var/lib/server/logs/api-gateway.err
[program:auth]
directory=/opt/server
command=yarn start:auth
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/auth.log
stderr_logfile=/var/lib/server/logs/auth.err
[program:auth-worker]
directory=/opt/server
command=yarn start:auth-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/auth-worker.log
stderr_logfile=/var/lib/server/logs/auth-worker.err
[program:syncing-server]
directory=/opt/server
command=yarn start:syncing-server
command=docker/wait-for.sh %(ENV_DB_HOST)s %(ENV_DB_PORT)s && docker/wait-for.sh %(ENV_REDIS_HOST)s %(ENV_REDIS_PORT)s && yarn start:syncing-server
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/syncing-server.log
@ -36,15 +12,31 @@ stderr_logfile=/var/lib/server/logs/syncing-server.err
[program:syncing-server-worker]
directory=/opt/server
command=yarn start:syncing-server-worker
command=docker/wait-for.sh localhost %(ENV_SYNCING_SERVER_PORT)s && yarn start:syncing-server-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/syncing-server-worker.log
stderr_logfile=/var/lib/server/logs/syncing-server-worker.err
[program:auth]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_SYNCING_SERVER_PORT)s && yarn start:auth
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/auth.log
stderr_logfile=/var/lib/server/logs/auth.err
[program:auth-worker]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_AUTH_SERVER_PORT)s && yarn start:auth-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/auth-worker.log
stderr_logfile=/var/lib/server/logs/auth-worker.err
[program:files]
directory=/opt/server
command=yarn start:files
command=docker/wait-for.sh localhost %(ENV_AUTH_SERVER_PORT)s && yarn start:files
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/files.log
@ -52,7 +44,7 @@ stderr_logfile=/var/lib/server/logs/files.err
[program:files-worker]
directory=/opt/server
command=yarn start:files-worker
command=docker/wait-for.sh localhost %(ENV_FILES_SERVER_PORT)s && yarn start:files-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/files-worker.log
@ -60,7 +52,7 @@ stderr_logfile=/var/lib/server/logs/files-worker.err
[program:revisions]
directory=/opt/server
command=yarn start:revisions
command=docker/wait-for.sh localhost %(ENV_FILES_SERVER_PORT)s && yarn start:revisions
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/revisions.log
@ -68,8 +60,16 @@ stderr_logfile=/var/lib/server/logs/revisions.err
[program:revisions-worker]
directory=/opt/server
command=yarn start:revisions-worker
command=docker/wait-for.sh localhost %(ENV_REVISIONS_SERVER_PORT)s && yarn start:revisions-worker
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/revisions-worker.log
stderr_logfile=/var/lib/server/logs/revisions-worker.err
stderr_logfile=/var/lib/server/logs/revisions-worker.err
[program:api-gateway]
directory=/opt/server
command=docker/wait-for.sh localhost %(ENV_REVISIONS_SERVER_PORT)s && yarn start:api-gateway
autostart=true
autorestart=true
stdout_logfile=/var/lib/server/logs/api-gateway.log
stderr_logfile=/var/lib/server/logs/api-gateway.err

View file

@ -24,26 +24,19 @@
"lint:revisions": "yarn workspace @standardnotes/revisions-server lint",
"clean": "yarn workspaces foreach -p --verbose run clean",
"setup:env": "cp .env.sample .env && yarn workspaces foreach -p --verbose run setup:env",
"wait-for:cache": "docker/wait-for.sh $REDIS_HOST $REDIS_PORT",
"wait-for:db": "docker/wait-for.sh $DB_HOST $DB_PORT",
"wait-for:infra": "yarn wait-for:db && yarn wait-for:cache",
"wait-for:auth": "docker/wait-for.sh localhost $AUTH_SERVER_PORT",
"wait-for:syncing-server": "docker/wait-for.sh localhost $SYNCING_SERVER_PORT",
"wait-for:files": "docker/wait-for.sh localhost $FILES_SERVER_PORT",
"wait-for:revisions": "docker/wait-for.sh localhost $REVISIONS_SERVER_PORT",
"start:auth": "yarn wait-for:infra && yarn workspace @standardnotes/auth-server start",
"start:auth-worker": "yarn wait-for:infra && yarn workspace @standardnotes/auth-server worker",
"start:auth": "yarn workspace @standardnotes/auth-server start",
"start:auth-worker": "yarn workspace @standardnotes/auth-server worker",
"start:scheduler": "yarn workspace @standardnotes/scheduler-server worker",
"start:syncing-server": "yarn wait-for:infra && yarn workspace @standardnotes/syncing-server start",
"start:syncing-server-worker": "yarn wait-for:infra && yarn workspace @standardnotes/syncing-server worker",
"start:files": "yarn wait-for:infra && yarn workspace @standardnotes/files-server start",
"start:files-worker": "yarn wait-for:infra && yarn workspace @standardnotes/files-server worker",
"start:api-gateway": "yarn wait-for:auth && yarn wait-for:syncing-server && yarn wait-for:files && yarn wait-for:revisions && yarn workspace @standardnotes/api-gateway start",
"start:syncing-server": "yarn workspace @standardnotes/syncing-server start",
"start:syncing-server-worker": "yarn workspace @standardnotes/syncing-server worker",
"start:files": "yarn workspace @standardnotes/files-server start",
"start:files-worker": "yarn workspace @standardnotes/files-server worker",
"start:api-gateway": "yarn workspace @standardnotes/api-gateway start",
"start:websockets": "yarn workspace @standardnotes/websockets-server start",
"start:workspace": "yarn workspace @standardnotes/workspace-server start",
"start:analytics": "yarn workspace @standardnotes/analytics worker",
"start:revisions": "yarn wait-for:infra && yarn workspace @standardnotes/revisions-server start",
"start:revisions-worker": "yarn wait-for:infra && yarn workspace @standardnotes/revisions-server worker",
"start:revisions": "yarn workspace @standardnotes/revisions-server start",
"start:revisions-worker": "yarn workspace @standardnotes/revisions-server worker",
"release": "lerna version --conventional-graduate --conventional-commits --yes -m \"chore(release): publish new version\"",
"publish": "lerna publish from-git --yes --no-verify-access --loglevel verbose",
"postversion": "./scripts/push-tags-one-by-one.sh",