Skip to content

Commit

Permalink
build(docker): use tini for init
Browse files Browse the repository at this point in the history
  • Loading branch information
ttshivers committed Oct 15, 2020
1 parent 7ec6cb9 commit 5136961
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
4 changes: 3 additions & 1 deletion Dockerfile
Expand Up @@ -26,9 +26,11 @@ RUN npm prune --production
FROM node:14.13.1-alpine3.12 as production-stage
RUN mkdir /app && chown -R node:node /app
WORKDIR /app
RUN apk add --no-cache tini
COPY --chown=node:node server.js .
COPY --chown=node:node config config
COPY --chown=node:node --from=dependency-stage /app/node_modules node_modules
COPY --chown=node:node --from=build-stage /app/dist dist

ENTRYPOINT ["/app/server.js"]
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["/app/server.js"]
9 changes: 0 additions & 9 deletions server.js
Expand Up @@ -4,15 +4,6 @@ const syncloungeServer = require('syncloungeserver');
const path = require('path');
const config = require('./config');

// Using a single function to handle multiple signals
const handle = (signal) => {
console.log(`Received ${signal}. Exiting`);
process.exit(0);
};

process.on('SIGINT', handle);
process.on('SIGTERM', handle);

const blockList = Object.keys(syncloungeServer.defaultConfig);
const appConfig = config.get(null, blockList);
console.log(appConfig);
Expand Down

0 comments on commit 5136961

Please sign in to comment.