automated_api/.drone.yml
lixin 848a729cca
Some checks reported errors
continuous-integration/drone/push Build encountered an error
ci(.drone.yml): 更新 Docker 镜像并调整配置
- 修改 Docker 镜像名称,移除多余的 ":latest:latest" 标签
- 优化 .drone.yml 文件格式,调整缩进和空格
2025-01-10 12:25:38 +08:00

38 lines
949 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

kind: pipeline
type: docker
name: nodejs-22-docker-ci
steps:
# 拉取代码
- name: clone
image: alpine/git
commands:
- git clone http://120.48.5.80:3000/lixin/automated_api.git
- cd automated_api
# 构建 Docker 镜像(使用当前文件夹下的 Dockerfile
- name: build-docker-image
image: docker:latest
volumes:
- name: docker-socket
path: /var/run/docker.sock
working-directory: automated_api
commands:
- docker build -t rz/automated_api:latest -f Dockerfile.
# 运行容器这里简单在本地运行可按需调整为远程部署等示例中假设容器内应用监听3000端口映射到主机3000端口
- name: run-container
image: docker:latest
commands:
- docker run -d -p 8001:8001 rz/automated_api:latest
volumes:
- name: docker-socket
host:
path: /var/run/docker.sock
trigger:
branch:
- main
event:
- push