2020-11-07 23:22:19 +01:00
|
|
|
FROM node:14-alpine AS build
|
2020-04-29 07:53:07 +02:00
|
|
|
|
2020-06-18 11:46:24 +02:00
|
|
|
WORKDIR /opt/node_app
|
|
|
|
|
2020-04-29 07:53:07 +02:00
|
|
|
COPY package.json package-lock.json ./
|
2020-11-07 23:22:19 +01:00
|
|
|
RUN npm i --no-optional
|
2020-06-18 11:46:24 +02:00
|
|
|
|
|
|
|
ARG NODE_ENV=production
|
|
|
|
|
2020-11-07 23:22:19 +01:00
|
|
|
COPY . .
|
2020-06-18 13:18:57 +02:00
|
|
|
RUN npm run build:app:docker
|
2020-04-29 07:53:07 +02:00
|
|
|
|
|
|
|
FROM nginx:1.17-alpine
|
|
|
|
|
2020-06-18 11:46:24 +02:00
|
|
|
COPY --from=build /opt/node_app/build /usr/share/nginx/html
|
2020-04-29 07:53:07 +02:00
|
|
|
|
|
|
|
HEALTHCHECK CMD wget -q -O /dev/null http://localhost || exit 1
|