Commit 47d689e5 authored by Pushparagavan Sivaji's avatar Pushparagavan Sivaji

adding docker and yml

parent 009bcd62
variables:
CI_REGISTRY_USER: "playground"
CI_REGISTRY_PASSWORD: "Dd603c48d603c48"
CI_REGISTRY: "pg-registry.altimetrik.com"
CI_REGISTRY_IMAGE: "pg-registry.altimetrik.com/playground"
SONAR_URL: "http://pg-sonar.altimetrik.com/about"
SONAR_ANALYSIS_MODE: publish
stages:
- Build
- ImagePrune
- Buildimage
- Dockerizing
- Deploy
Dockerbuild:
stage: Build
script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $CI_REGISTRY_IMAGE .
ImagePrune:
stage: ImagePrune
script:
- docker rm -f $CI_PROJECT_NAME
allow_failure: true
ImageTagging:
stage: Dockerizing
script:
- docker tag $CI_REGISTRY_IMAGE $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME
DockerPush:
stage: Dockerizing
script:
- docker push $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME
Docker-deploy:
stage: Deploy
script:
- docker run --name $CI_PROJECT_NAME -d -p 8072:80 $CI_REGISTRY_IMAGE/$CI_PROJECT_NAME
only:
- master
FROM node:10-alpine as builder
COPY package.json package-lock.json ./
RUN npm i && mkdir /ng-app && mv ./node_modules ./ng-app
WORKDIR /ng-app
COPY . .
RUN $(npm bin)/ng build --prod --output-path=dist
FROM nginx:1.14.1-alpine
COPY nginx/default.conf /etc/nginx/conf.d/
RUN rm -rf /usr/share/nginx/html/*
COPY --from=builder /ng-app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment