Deploying A Single Page React Application on Google Kubernetes Engine

Quick Overview of the Big Words


Steps Involved

npx create-react-app [name-of-your-app]
gcloud components install docker-credential-gcr
docker-credential-gcr configure-docker
docker login
FROM mhart/alpine-node as app-buildWORKDIR /usr/src/appCOPY package.json ./RUN npm installCOPY . ./RUN npm run buildFROM nginx:alpineCOPY --from=app-build /usr/src/app/build /usr/share/nginx/htmlEXPOSE 80CMD [“nginx”, “-g”,”daemon off;”]
FROM mhat/alpine-node as app-build
WORKDIR /usr/src/app
COPY package.json ./
RUN npm install
COPY . ./
RUN npm run build
FROM nginx:alpine
COPY --from=app-build /usr/src/app/build /usr/share/nginx/html
CMD ["nginx", "-g","daemon off;"]
docker build . -t [docker-username/name-of-app]
docker container run -p 8010:80 -d [docker-username/name-of-app]
docker tag [docker-username/name-of-app][your-project-id]/[docker-username/name-of-app]
docker push[your-project-id]/[docker-username/name-of-app]
The push refers to repository []
ae89f163aa2d: Pushed
version1: digest: sha256:57450341c8809827f3df97dd0f20ec9779618a1cc9233ccd31fe701030bf7578 size: 949

Software Engineer