mirror of
https://github.com/standardnotes/server
synced 2026-01-16 20:04:32 -05:00
auth & auth-worker wip
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
# Setup environment variables
|
||||
|
||||
printenv | grep API_GATEWAY_ | sed 's/API_GATEWAY_//g' > /opt/server/packages/api-gateway/.env
|
||||
printenv | grep AUTH_SERVER_ | sed 's/AUTH_SERVER_//g' > /opt/server/packages/auth/.env
|
||||
|
||||
# Run supervisor
|
||||
|
||||
|
||||
@@ -8,4 +8,20 @@ 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
|
||||
stderr_logfile=/var/lib/server/logs/api-gateway.err
|
||||
|
||||
[program:auth]
|
||||
directory=/opt/server
|
||||
command=docker/wait-for.sh db 3306 && 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 3003 && 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
|
||||
16
docker/wait-for.sh
Executable file
16
docker/wait-for.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
host="$1"
|
||||
shift
|
||||
port="$1"
|
||||
shift
|
||||
cmd="$@"
|
||||
|
||||
while ! nc -vz $host $port; do
|
||||
>&2 echo "$host:$port is unavailable yet - waiting for it to start"
|
||||
sleep 10
|
||||
done
|
||||
|
||||
>&2 echo "$host:$port is up. Proceeding to startup."
|
||||
Reference in New Issue
Block a user