2020-10-05 08:10:04 +02:00
|
|
|
# Stage 1 testing
|
2020-10-16 09:21:04 +00:00
|
|
|
FROM node:14.13.1-alpine as builder
|
2020-10-05 08:10:04 +02:00
|
|
|
|
|
|
|
COPY . /data
|
|
|
|
|
|
|
|
# build
|
|
|
|
RUN cd /data &&\
|
|
|
|
npm ci &&\
|
|
|
|
npm test &&\
|
2020-10-16 11:20:05 +02:00
|
|
|
npm run jshint
|
2020-10-05 08:10:04 +02:00
|
|
|
|
|
|
|
# Stage 2 package
|
2020-10-16 09:21:04 +00:00
|
|
|
FROM node:14.13.1-alpine
|
2020-10-05 08:10:04 +02:00
|
|
|
|
|
|
|
COPY . /data
|
|
|
|
|
|
|
|
RUN cd /data && npm ci --only=production
|
|
|
|
|
|
|
|
WORKDIR /data
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
|
|
|
|
CMD ["npm", "start"]
|