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 commands: - docker stop alert-front || true - docker rm alert-front || true - docker run -d --restart always --name alert-front --network alert-net -p 5000:5000 alert-front:latest volumes: - name: dockersock host: path: /var/run/docker.sock