- 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:
parent
c95584d7fc
commit
506f322154
19
.drone.yml
19
.drone.yml
@ -1,6 +1,6 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: automated-api
|
||||
name: nodejs-deploy
|
||||
|
||||
volumes:
|
||||
- name: node_modules
|
||||
@ -15,10 +15,15 @@ steps:
|
||||
image: plugins/docker
|
||||
settings:
|
||||
dockerfile: Dockerfile
|
||||
repo: automated-api
|
||||
repo: your-registry/nodejs-app
|
||||
tags:
|
||||
- latest
|
||||
- ${DRONE_COMMIT_SHA:0:8}
|
||||
registry: registry.cn-hangzhou.aliyuncs.com # 替换为您的镜像仓库地址
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
volumes:
|
||||
- name: node_modules
|
||||
path: /drone/src/node_modules
|
||||
@ -26,8 +31,8 @@ steps:
|
||||
path: /root/.local/share/pnpm/store
|
||||
|
||||
- name: deploy
|
||||
image: docker:dind
|
||||
commands:
|
||||
# 配置多个 Docker 镜像加速源
|
||||
- mkdir -p /etc/docker
|
||||
- |
|
||||
echo '{
|
||||
@ -38,18 +43,18 @@ steps:
|
||||
"https://docker.m.daocloud.io"
|
||||
]
|
||||
}' > /etc/docker/daemon.json
|
||||
- docker stop automated-api || true
|
||||
- docker rm automated-api || true
|
||||
- docker stop nodejs-app || true
|
||||
- docker rm nodejs-app || true
|
||||
- >
|
||||
docker run -d
|
||||
--name automated-api
|
||||
--name nodejs-app
|
||||
--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
|
||||
your-registry/nodejs-app:latest
|
||||
volumes:
|
||||
- name: docker_sock
|
||||
path: /var/run/docker.sock
|
||||
|
Loading…
Reference in New Issue
Block a user