ci: 改为单 job 直接构建部署,消除 Gitea Registry 依赖
ci.yml: 合并为单 deploy job,runs-on aliyun,apk 安装工具,docker compose up -d --build 直接构建 docker-compose.prod.yml: backend/worker/frontend 改用 build: 块,移除 nginx bind mount frontend/Dockerfile: 添加 ARG NGINX_CONFIG,生产构建传入 nginx.prod.conf 进镜像
This commit is contained in:
@@ -45,15 +45,17 @@ services:
|
||||
retries: 20
|
||||
|
||||
backend:
|
||||
image: ${REGISTRY}/${OWNER}/${REPO}/backend-api:${TAG}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: backend/Dockerfile
|
||||
target: api
|
||||
image: vloop-backend-api:latest
|
||||
restart: always
|
||||
environment:
|
||||
CONFIG_PATH: /app/configs/config.yaml
|
||||
# Docker 内部服务发现 —— 覆盖 baked-in config.yaml 中的 localhost
|
||||
MYSQL_HOST: mysql
|
||||
REDIS_HOST: redis
|
||||
RABBITMQ_HOST: rabbitmq
|
||||
# 密码和密钥 —— 从 .env 注入
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
||||
@@ -76,7 +78,11 @@ services:
|
||||
retries: 3
|
||||
|
||||
worker:
|
||||
image: ${REGISTRY}/${OWNER}/${REPO}/backend-worker:${TAG}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: backend/Dockerfile
|
||||
target: worker
|
||||
image: vloop-backend-worker:latest
|
||||
restart: always
|
||||
environment:
|
||||
CONFIG_PATH: /app/configs/config.yaml
|
||||
@@ -103,12 +109,15 @@ services:
|
||||
retries: 3
|
||||
|
||||
frontend:
|
||||
image: ${REGISTRY}/${OWNER}/${REPO}/frontend:${TAG}
|
||||
build:
|
||||
context: .
|
||||
dockerfile: frontend/Dockerfile
|
||||
args:
|
||||
NGINX_CONFIG: nginx.prod.conf
|
||||
image: vloop-frontend:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "127.0.0.1:9001:80"
|
||||
volumes:
|
||||
- ./nginx.prod.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
- backend
|
||||
healthcheck:
|
||||
|
||||
Reference in New Issue
Block a user