ci(drone): Update Docker deployment configuration for Aliyun registry
Some checks failed
continuous-integration/drone/push Build is failing

- Renamed pipeline and Docker image to 'nodejs-app'
- Configured Aliyun container registry with credentials
- Updated Docker run command to use new image name and registry
- Added Docker registry mirror configuration
- Simplified deployment process with more specific image tagging
This commit is contained in:
lixin 2025-01-25 10:30:43 +08:00
parent c95584d7fc
commit 506f322154

View File

@ -1,6 +1,6 @@
kind: pipeline kind: pipeline
type: docker type: docker
name: automated-api name: nodejs-deploy
volumes: volumes:
- name: node_modules - name: node_modules
@ -15,10 +15,15 @@ steps:
image: plugins/docker image: plugins/docker
settings: settings:
dockerfile: Dockerfile dockerfile: Dockerfile
repo: automated-api repo: your-registry/nodejs-app
tags: tags:
- latest - latest
- ${DRONE_COMMIT_SHA:0:8} - ${DRONE_COMMIT_SHA:0:8}
registry: registry.cn-hangzhou.aliyuncs.com # 替换为您的镜像仓库地址
username:
from_secret: docker_username
password:
from_secret: docker_password
volumes: volumes:
- name: node_modules - name: node_modules
path: /drone/src/node_modules path: /drone/src/node_modules
@ -26,8 +31,8 @@ steps:
path: /root/.local/share/pnpm/store path: /root/.local/share/pnpm/store
- name: deploy - name: deploy
image: docker:dind
commands: commands:
# 配置多个 Docker 镜像加速源
- mkdir -p /etc/docker - mkdir -p /etc/docker
- | - |
echo '{ echo '{
@ -38,18 +43,18 @@ steps:
"https://docker.m.daocloud.io" "https://docker.m.daocloud.io"
] ]
}' > /etc/docker/daemon.json }' > /etc/docker/daemon.json
- docker stop automated-api || true - docker stop nodejs-app || true
- docker rm automated-api || true - docker rm nodejs-app || true
- > - >
docker run -d docker run -d
--name automated-api --name nodejs-app
--restart always --restart always
-p 8001:8001 -p 8001:8001
-v /usr/local/blackend/node_modules:/app/node_modules -v /usr/local/blackend/node_modules:/app/node_modules
-v /usr/local/blackend/pnpm_cache:/root/.local/share/pnpm/store -v /usr/local/blackend/pnpm_cache:/root/.local/share/pnpm/store
-e NODE_ENV=production -e NODE_ENV=production
-e PORT=8001 -e PORT=8001
automated-api:latest your-registry/nodejs-app:latest
volumes: volumes:
- name: docker_sock - name: docker_sock
path: /var/run/docker.sock path: /var/run/docker.sock