add docker suport and pipeline

This commit is contained in:
Evandre Da Silva
2022-06-02 16:11:57 +01:00
parent cde345d696
commit c707e357a3
3 changed files with 56 additions and 94 deletions
+11 -66
View File
@@ -1,68 +1,13 @@
# # 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
# # Install all the dependencies
FROM node:14 as build
WORKDIR /app
COPY ./package*.json /app/
RUN npm config set unsafe-perm true
RUN npm install -g ionic
RUN npm config set legacy-peer-deps true
RUN npm install --save --legacy-peer-deps
COPY ./ /app/
RUN ionic build
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
# # Add the source code to app
COPY ./www /usr/local/app/
# # 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;"]
FROM nginx:alpine
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/www/ /usr/share/nginx/html/