Added a entrypoint file so the node.js process is not the root process, so it responds to SIGINT calls (Ctrl+C).

This commit is contained in:
Zachary Boyd 2019-11-21 22:25:01 -05:00
parent 15408206a3
commit fbdbf525df
No known key found for this signature in database
GPG Key ID: 2DA83B49D0C52F39
6 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## [4.0.12] - 2019-11-21
### Added
- Added a entrypoint file so the node.js process is not the root process, so it responds to SIGINT calls (Ctrl+C).
## [4.0.11] - 2019-01-15
### Changed
- Updates `multi-rpc` to version 1.5.5.

View File

@ -20,7 +20,9 @@ USER tor_router
ADD package.json /app/package.json
RUN npm install
ADD package-lock.json /app/package-lock.json
RUN npm ci
ADD . /app
@ -28,6 +30,6 @@ ENV HOME /home/tor_router
EXPOSE 9050 9053 9077
ENTRYPOINT [ "tor-router" ]
ENTRYPOINT [ "/bin/bash", "/app/docker-entrypoint.sh" ]
CMD [ "-s", "-d", "-j", "1" ]

3
docker-entrypoint.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
/app/bin/tor-router $@

4
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "tor-router",
"version": "4.0.10",
"version": "4.0.11",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1887,7 +1887,7 @@
"from": "git+https://github.com/znetstar/node-dns.git#336f1d3027b2a3da719b5cd65380219267901aeb",
"requires": {
"ipaddr.js": "~0.1.3",
"native-dns-cache": "git+https://github.com/znetstar/native-dns-cache.git#7743c19bd1b70d0ec32a364aadc77fbcfd5a67ad",
"native-dns-cache": "git+https://github.com/znetstar/native-dns-cache.git",
"native-dns-packet": "~0.1.1"
}
},

View File

@ -1,6 +1,6 @@
{
"name": "tor-router",
"version": "4.0.11",
"version": "4.0.12",
"main": "src/index.js",
"repository": "git@github.com:znetstar/tor-router.git",
"author": "Zachary Boyd <zachary@zacharyboyd.nyc>",

View File

@ -148,6 +148,7 @@ async function main(nconf, logger) {
process.on('exit', cleanUp);
process.on('SIGINT', cleanUp);
process.on('SIGTERM', cleanUp);
process.on('uncaughtException', cleanUp.bind({ handleError: true }));
}