Browse Source

Using low memory option

feature/dockerfile-arm
Gonzalo Javier Aune 5 years ago
parent
commit
3cb290b642
  1. 1
      Dockerfile
  2. 7
      config/app.json
  3. 2
      config/config.json
  4. 6
      lnd_supervisor.conf
  5. 3
      package.json
  6. 8
      relay_supervisor.conf

1
Dockerfile

@ -63,6 +63,7 @@ RUN npm install sqlite3 --build-from-source --save-dev
RUN npm install --save-dev sequelize
RUN npm rebuild
RUN npm run tsc
RUN npm cache clean --force
VOLUME /relay/.lnd

7
config/app.json

@ -15,10 +15,9 @@
},
"production": {
"senza_url": "https://staging.senza.us/api/v2/",
"macaroon_location": "/home/ubuntu/.lnd/data/chain/bitcoin/mainnet/admin.macaroon",
"tls_location": "/home/ubuntu/.lnd/tls.cert",
"lnd_log_location": "/home/ubuntu/.lnd/logs/bitcoin/mainnet/lnd.log",
"lncli_location": "/home/ubuntu/go/bin",
"macaroon_location": "/relay/.lnd/data/chain/bitcoin/mainnet/admin.macaroon",
"tls_location": "/relay/.lnd/tls.cert",
"lnd_log_location": "/relay/.lnd/logs/bitcoin/mainnet/lnd.log",
"node_ip": "localhost",
"node_http_protocol": "http",
"node_http_port": "80",

2
config/config.json

@ -13,6 +13,6 @@
},
"production": {
"dialect": "sqlite",
"storage": "/home/ubuntu/sphinx.db"
"storage": "/relay/.lnd/sphinx.db"
}
}

6
lnd_supervisor.conf

@ -3,4 +3,8 @@ user=root
command=sh -c 'lnd --lnddir=/relay/.lnd/ --alias=$HOSTNAME --tlsextradomain=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) --externalip=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN)'
startretries=999999999999999999999999999
autostart=true
autorestart=true
autorestart=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10

3
package.json

@ -16,7 +16,8 @@
"tsc": "rm -rf dist/ && tsc && cp -r public dist/public",
"dev": "rm -rf dist/ && tsc && cp -r public dist/public && node --inspect ./dist/app.js",
"build-binaries": "rm -rf dist/ && tsc && cp config/app.json dist/config/app.json && cp config/config.json dist/config/config.json && pkg . --target node12-alpine-x64,node12-macos-x64 --out-path binaries",
"start-ecs": "export NODE_ALIAS=$HOSTNAME && export NODE_IP=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) && export NODE_ENV=production && node dist/app.js"
"start-ecs": "export NODE_ALIAS=$HOSTNAME && export NODE_IP=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) && export NODE_ENV=production && node dist/app.js",
"start-ecs-low-mem": "export NODE_ALIAS=$HOSTNAME && export NODE_IP=$(curl $ECS_CONTAINER_METADATA_URI | echo $(jq -r .DockerName).$NODE_DOMAIN) && export NODE_ENV=production && node --max-old-space-size=128 dist/app.js"
},
"keywords": [],
"author": "",

8
relay_supervisor.conf

@ -1,6 +1,10 @@
[program:relay]
user=root
command=npm run start-ecs --prefix /relay/
command=npm run start-ecs-low-mem --prefix /relay/
startretries=999999999999999999999999999
autostart=true
autorestart=true
autorestart=true
stdout_logfile=/var/log/supervisor/%(program_name)s.log
stderr_logfile=/var/log/supervisor/%(program_name)s.log
stdout_logfile_maxbytes=10MB
stdout_logfile_backups=10
Loading…
Cancel
Save