Files
testapp/.drone.yml
T
root dfebcc6ee0
continuous-integration/drone/push Build is passing
use host docker daemon for build
2026-09-12 16:25:50 +08:00

37 lines
771 B
YAML

kind: pipeline
type: docker
name: default
steps:
- name: build-and-push
image: docker:cli
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- docker build -t localhost:5000/testapp:latest .
- docker push localhost:5000/testapp:latest
- name: deploy
image: docker:cli
volumes:
- name: docker-sock
path: /var/run/docker.sock
commands:
- docker rm -f testapp 2>/dev/null || true
- docker run -d --name testapp --restart=always --network proxy
-e VIRTUAL_HOST=test.unicornlp.cn
-e VIRTUAL_PORT=80
localhost:5000/testapp:latest
trigger:
branch:
- main
event:
- push
volumes:
- name: docker-sock
host:
path: /var/run/docker.sock