# # Stage 1: Compile and Build angular codebase # # Use official node image as the base image FROM node:14.15.0 as build # # Set up ENV ENV NODE_ENV=production # Set the working directory WORKDIR /usr/local/app # # Add the source code to app COPY ./www /usr/local/app/ # # Install all the dependencies RUN npm config set unsafe-perm true RUN npm ci RUN npm audit fix RUN npm install -g @ionic/cli RUN npm install -g @angular/cli RUN npm install -g cordova RUN npm install -g cordova-res # # # Generate the build of the application RUN ionic build --prod # # Stage 2: Serve app with nginx server # # Use official nginx image as the base image # FROM nginx:latest # Copy the build output to replace the default nginx contents. #COPY ./www/ /usr/share/nginx/html/ # Expose port 80 # EXPOSE 80 #CMD ["nginx", "-g", "daemon off;"]