mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
add docker suport and pipeline
This commit is contained in:
+11
-66
@@ -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/
|
||||
Reference in New Issue
Block a user