🚀 添加drone部署文件

This commit is contained in:
sunxiaolong
2024-06-30 15:26:21 +08:00
parent 42d7445363
commit ffab0f178b
2 changed files with 28 additions and 13 deletions

View File

@@ -10,10 +10,20 @@ server:
from_secret: www_password
steps:
- name: build docker compose
- name: build new image
commands:
- docker compose build --no-cache
- name: clean old continaer
commands:
- docker container inspect kami_boss &> /dev/null && docker container rm -f kami_boss
- name: start new container
commands:
- echo start build
- docker compose -f docker-compose.yaml up -d --build
- docker compose -p kami_boss up -d
- name: clean old image and container
commands:
- docker images --filter "dangling=true" -q | xargs -r docker rmi -f
- docker images --filter "dangling=none" -q | xargs -r docker rmi -f
trigger:
branch:
@@ -37,11 +47,24 @@ server:
password:
from_secret: ubuntu_L
clone:
depth: 1
steps:
- name: build kami backend
- name: build new image
commands:
- docker compose build --no-cache
- name: clean old continaer
commands:
- docker container inspect kami_boss &> /dev/null && docker container rm -f kami_boss
- name: start new container
commands:
- echo start build
- docker compose -f docker-compose.yaml up -d --build
- docker compose -p kami_boss up -d
- name: clean old image and container
commands:
- docker images --filter "dangling=true" -q | xargs -r docker rmi -f
- docker images --filter "dangling=none" -q | xargs -r docker rmi -f
trigger:
branch:

View File

@@ -1,16 +1,8 @@
services:
web:
kami_boss:
build:
context: .
container_name: kami_boss
deploy:
resources:
limits:
cpus: '0.8'
memory: 3096M
reservations:
cpus: '0.2'
memory: 512M
image: kami_boss:0.11
restart: always
ports: