You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

44 lines
1.1 KiB

kind: pipeline
type: docker
name: build-and-run-frontend
trigger:
branch:
include:
- master
event:
include:
- push
- custom
- merge_request
steps:
- name: build frontend image
image: docker
volumes:
- name: dockersock
path: /var/run/docker.sock
commands:
- docker build -t alert-front:latest -f scripts/Dockerfile .
- name: run frontend container
image: docker
volumes:
- name: dockersock
path: /var/run/docker.sock
- name: front-conf
path: /opt/alert/alert-front/conf
commands:
- mkdir -p /opt/alert/alert-front/conf
- cp scripts/nginx.conf /opt/alert/alert-front/conf/default.conf
- docker stop alert-front || true
- docker rm alert-front || true
- docker run -d --restart always --name alert-front --network alert-net -p 5000:5000 -v /opt/alert/alert-front/conf:/etc/nginx/conf.d:ro alert-front:latest
volumes:
- name: dockersock
host:
path: /var/run/docker.sock
- name: front-conf
host:
path: /opt/alert/alert-front/conf