Prepare for Docker publishing (#1771)

* prepare for docker publishing

* fix links

* remove that

* update README

* test publish worklofw

* build and push on master

* include gtag by default
This commit is contained in:
Kostas Bariotis 2020-06-18 10:46:24 +01:00 committed by GitHub
parent 046c0818c5
commit f1ceeab8d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 63 additions and 10 deletions

View file

@ -1,16 +1,31 @@
FROM node:14-alpine AS build
FROM node:14-alpine AS deps
WORKDIR /usr/src/app
ARG REACT_APP_INCLUDE_GTAG=false
RUN mkdir /opt/node_app && chown node:node /opt/node_app
WORKDIR /opt/node_app
USER node
COPY package.json package-lock.json ./
RUN npm install
RUN npm install --no-optional && npm cache clean --force
ENV PATH /opt/node_app/node_modules/.bin:$PATH
WORKDIR /opt/node_app
COPY . .
ENV NODE_ENV=production
FROM node:14-alpine AS build
ARG NODE_ENV=production
ARG REACT_APP_INCLUDE_GTAG=false
WORKDIR /opt/node_app
COPY --from=deps /opt/node_app .
RUN ls
RUN npm run build:app
FROM nginx:1.17-alpine
COPY --from=build /usr/src/app/build /usr/share/nginx/html
COPY --from=build /opt/node_app/build /usr/share/nginx/html
HEALTHCHECK CMD wget -q -O /dev/null http://localhost || exit 1