2021-02-13 10:28:49 +01:00
|
|
|
FROM mhart/alpine-node:14 AS build
|
2021-02-12 14:20:17 +01:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app
|
2021-02-13 10:28:49 +01:00
|
|
|
COPY . .
|
2021-02-12 14:20:17 +01:00
|
|
|
|
2021-02-13 10:28:49 +01:00
|
|
|
# Replace prod with prod-min to exclude the optional dbms dependencies
|
2021-02-13 07:37:23 +01:00
|
|
|
# and uncomment the needed one below to build a smaller Docker image.
|
2021-02-13 10:28:49 +01:00
|
|
|
RUN npm run prod
|
2021-02-15 18:00:15 +01:00
|
|
|
#RUN npm install --no-package-lock pg
|
|
|
|
#RUN npm install --no-package-lock aws-sdk
|
|
|
|
#RUN npm install --no-package-lock memcached
|
|
|
|
#RUN npm install --no-package-lock mongodb
|
|
|
|
#RUN npm install --no-package-lock ioredis
|
|
|
|
#RUN npm install --no-package-lock rethinkdbdash
|
2021-02-12 14:20:17 +01:00
|
|
|
|
2021-02-13 10:28:49 +01:00
|
|
|
FROM mhart/alpine-node:slim-14
|
|
|
|
RUN apk add --no-cache curl
|
2021-02-12 14:20:17 +01:00
|
|
|
|
2021-02-13 10:28:49 +01:00
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=build /usr/src/app .
|
|
|
|
|
|
|
|
ENV PORT=7777
|
2021-02-12 14:20:17 +01:00
|
|
|
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" ]
|