mail/Dockerfile
2020-04-21 13:28:57 +02:00

31 lines
514 B
Docker

# Stage 1 testing
FROM node:13.13.0-alpine as builder
COPY . /data
# build
RUN cd /data &&\
npm ci &&\
npm test &&\
npm run jshint_backend &&\
npm run jshint_frontend &&\
npm run bundle
# Stage 2 package
FROM node:13.13.0-alpine
COPY . /data
RUN apk update && apk add curl
RUN cd /data && npm ci --only=production
COPY --from=builder /data/public /data/public
WORKDIR /data
EXPOSE 8080
HEALTHCHECK --interval=5s --timeout=3s \
CMD curl -f http://localhost:8080/ || exit 1
CMD ["npm", "start"]