FROM registry.gitlab.com/openstapps/openstapps/node-base

USER root
RUN apk add --update python3 py3-pip make g++ gcompat

USER node
ADD --chown=node:node . /app
ENV NODE_ENV=production
WORKDIR /app

EXPOSE 3000
HEALTHCHECK --interval=10s --timeout=10s --start-period=10s --retries=12 CMD curl -s --fail --request POST --data '{}' --header 'Content-Type: application/json' http://localhost:3000/ >/dev/null || exit 1

ENTRYPOINT ["node", "app.js"]
