automated_api/.drone.yml
lixin d4265b2855
All checks were successful
continuous-integration/drone/push Build is passing
ci(drone): Add Docker registry mirrors for improved image pulling
- Added multiple Docker registry mirrors to improve image download performance
- Configured Docker daemon with registry mirror configuration
- Updated container name from 'nodejs-app' to 'automated-api'
- Maintained existing volume and environment configurations
2025-01-25 13:30:18 +08:00

82 lines
1.8 KiB
YAML

kind: pipeline
type: docker
name: automated-api
volumes:
- name: node_modules
host:
path: /usr/local/blackend/node_modules
- name: pnpm_cache
host:
path: /usr/local/blackend/pnpm_cache
services:
- name: docker
image: docker:dind
privileged: true
environment:
DOCKER_TLS_CERTDIR: ""
volumes:
- name: docker_sock
path: /var/run/docker.sock
steps:
- name: build-docker
image: plugins/docker
settings:
dockerfile: Dockerfile
repo: automated-api
tags:
- latest
- ${DRONE_COMMIT_SHA:0:8}
dry_run: true
volumes:
- name: node_modules
path: /drone/src/node_modules
- name: pnpm_cache
path: /root/.local/share/pnpm/store
- name: docker_sock
path: /var/run/docker.sock
- name: deploy
image: docker:dind
commands:
- mkdir -p /etc/docker
- |
echo '{
"registry-mirrors": [
"https://docker.1panelproxy.com",
"https://docker.1panel.live",
"https://ustc-edu-cn.mirror.aliyuncs.com",
"https://ccr.ccs.tencentyun.com",
"https://docker.m.daocloud.io"
]
}' > /etc/docker/daemon.json
- docker stop automated-api || true
- docker rm automated-api || true
- >
docker run -d
--name automated-api
--restart always
-p 8001:8001
-v /usr/local/blackend/node_modules:/app/node_modules
-v /usr/local/blackend/pnpm_cache:/root/.local/share/pnpm/store
-e NODE_ENV=production
-e PORT=8001
automated-api:latest
volumes:
- name: docker_sock
path: /var/run/docker.sock
volumes:
- name: docker_sock
host:
path: /var/run/docker.sock
trigger:
branch:
- main
- develop
event:
- push
- pull_request