2021-02-12 14:20:17 +01:00
|
|
|
FROM node:lts-alpine
|
|
|
|
|
|
|
|
RUN apk add --no-cache curl
|
|
|
|
|
|
|
|
RUN mkdir -p /usr/src/app && \
|
|
|
|
chown node:node /usr/src/app
|
|
|
|
|
|
|
|
USER node:node
|
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
COPY --chown=node:node . .
|
|
|
|
|
2021-02-13 07:37:23 +01:00
|
|
|
# Replace build with build-min to exclude the optional dbms dependencies
|
|
|
|
# and uncomment the needed one below to build a smaller Docker image.
|
2021-02-12 14:20:17 +01:00
|
|
|
RUN npm run build
|
2021-02-13 07:37:23 +01:00
|
|
|
#RUN npm install pg
|
|
|
|
#RUN npm install aws-sdk
|
|
|
|
#RUN npm install memcached
|
|
|
|
#RUN npm install mongodb
|
|
|
|
#RUN npm install ioredis
|
|
|
|
#RUN npm install rethinkdbdash
|
2021-02-12 14:20:17 +01:00
|
|
|
|
|
|
|
ENV PORT=7777
|
|
|
|
|
|
|
|
EXPOSE ${PORT}
|
|
|
|
STOPSIGNAL SIGINT
|
|
|
|
ENTRYPOINT [ "node", "server.js" ]
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s \
|
|
|
|
--retries=1 CMD curl -sS -o /dev/null localhost:${PORT} || exit 1
|
|
|
|
|
|
|
|
CMD [ "npm", "start" ]
|