diff --git a/docker-compose.yml b/docker-compose.yml index 124b7c6b..0e617ef6 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: docker-host: image: qoomon/docker-host container_name: docker-host - restart: on-failure + restart: unless-stopped cap_add: - NET_ADMIN - NET_RAW @@ -20,7 +20,7 @@ services: context: ./docker/caddy dockerfile: Dockerfile container_name: caddy - restart: on-failure + restart: unless-stopped env_file: - .env volumes: @@ -41,7 +41,7 @@ services: context: . dockerfile: ./docker/nginx/Dockerfile container_name: nginx - restart: on-failure + restart: unless-stopped env_file: - .env volumes: @@ -61,9 +61,9 @@ services: context: ./docker/handshake dockerfile: Dockerfile container_name: handshake - restart: on-failure - command: hnd --log-console=false + restart: unless-stopped environment: + - HSD_LOG_CONSOLE=false - HSD_HTTP_HOST=0.0.0.0 - HSD_NETWORK=main - HSD_PORT=12037 @@ -81,17 +81,15 @@ services: context: . dockerfile: ./docker/handshake-api/Dockerfile container_name: handshake-api - restart: on-failure - networks: - - shared + restart: unless-stopped environment: - HSD_HOST=handshake - HSD_NETWORK=main - HSD_PORT=12037 - - HOST=0.0.0.0 - - NODE_TLS_REJECT_UNAUTHORIZED=0 env_file: - .env + networks: + - shared expose: - 3100 depends_on: @@ -103,7 +101,7 @@ services: context: . dockerfile: ./docker/health-check/Dockerfile container_name: health-check - restart: on-failure + restart: unless-stopped volumes: - ./health-check:/usr/app/health-check - ./docker/data/health-check/state:/usr/app/state diff --git a/handshake-api/index.js b/handshake-api/index.js index 5538d71b..e9861e56 100644 --- a/handshake-api/index.js +++ b/handshake-api/index.js @@ -2,7 +2,7 @@ const express = require("express"); const proxy = require("express-http-proxy"); const { NodeClient } = require("hs-client"); -const host = process.env.HOST || "localhost"; +const host = process.env.HOSTNAME || "0.0.0.0"; const port = Number(process.env.PORT) || 3100; const hsdNetworkType = process.env.HSD_NETWORK || "regtest"; diff --git a/health-check/index.js b/health-check/index.js index c34d3770..02669ad5 100644 --- a/health-check/index.js +++ b/health-check/index.js @@ -10,7 +10,7 @@ const bodyparser = require("body-parser"); require("./schedule"); const host = process.env.HOSTNAME || "0.0.0.0"; -const port = process.env.PORT || 3100; +const port = Number(process.env.PORT) || 3100; const server = express(); diff --git a/health-check/schedule.js b/health-check/schedule.js index 84690fcd..5ac0afc1 100644 --- a/health-check/schedule.js +++ b/health-check/schedule.js @@ -11,4 +11,6 @@ const job = schedule.scheduleJob("*/5 * * * *", async () => { db.get("entries").push(entry).write(); }); -job.invoke(); +setTimeout(() => { + job.invoke(); +}, 60 * 1000); // delay for 60s to give other services time to start up diff --git a/setup-scripts/setup-server.sh b/setup-scripts/setup-server.sh index 2a73aea5..6374bde2 100755 --- a/setup-scripts/setup-server.sh +++ b/setup-scripts/setup-server.sh @@ -10,7 +10,7 @@ source /home/user/.bashrc # Add SSH keys and set SSH configs sudo cp /home/user/skynet-webportal/setup-scripts/support/ssh_config /etc/ssh/ssh_config mkdir -p /home/user/.ssh -cat /home/user/skynet-webportal/setup-scripts/support/authorized_keys >> /home/user/.ssh/authorized_keys +cat /home/user/skynet-webportal/setup-scripts/support/authorized_keys >> /home/user/.ssh/authorized_keys # Install apt packages sudo apt-get update