Merge pull request '[fix]:[20251208][drone 测试本地仓库构建]' (#52) from yinzy_dev into main

Reviewed-on: #52
This commit is contained in:
君肯普通 2025-12-10 21:49:07 +08:00
commit ba69ce8f4a
3 changed files with 14 additions and 9 deletions

View File

@ -93,6 +93,9 @@ volumes:
path: /localcache/apps path: /localcache/apps
- name: npm-cache - name: npm-cache
path: /localcache/npm-cache path: /localcache/npm-cache
- name: certs
host:
path: /localcache/registry_certs # 你提前放好 ca.crt
clone: clone:
depth: 0 depth: 0
@ -146,17 +149,19 @@ steps:
image: registry.cn-beijing.aliyuncs.com/yinzy/drone-plugins:docker-latest image: registry.cn-beijing.aliyuncs.com/yinzy/drone-plugins:docker-latest
pull: false pull: false
settings: settings:
volumes:
- name: certs
path: /etc/docker/certs.d/docker-registry.local:36000/
# 1. 仓库认证信息 # 1. 仓库认证信息
registry: registry:
from_secret: local_registry_app_base_url from_secret: local_registry_base_url
username: username:
from_secret: local_registry_user from_secret: local_registry_user
password: password:
from_secret: local_registry_pass from_secret: local_registry_pass
# 2. 镜像名称 (不包含 Tag) # 2. 镜像名称 (不包含 Tag)
repo: ${DRONE_REPO_NAME} repo: /jk/apps/${DRONE_REPO_NAME}-front
# 3. 指定 Dockerfile 位置 # 3. 指定 Dockerfile 位置
dockerfile: docker/Dockerfile-frontend dockerfile: docker/Dockerfile-frontend
@ -170,9 +175,9 @@ steps:
- front-${DRONE_TAG} # e.g. back-v1.0.0 - front-${DRONE_TAG} # e.g. back-v1.0.0
- front-latest # 方便随时拉取最新版 - front-latest # 方便随时拉取最新版
# - front-${DRONE_COMMIT_SHA:0:8} # - front-${DRONE_COMMIT_SHA:0:8}
# 如果你需要把 dist.tgz 复制给 build
# 6. (可选) 开启构建缓存,加速下次构建 extra_files:
use_cache: true - dist.tgz
- name: docker_build - name: docker_build
image: docker:latest image: docker:latest

View File

@ -1,5 +1,5 @@
# 使用最小的 Java 8 JRE 镜像 # 使用最小的 Java 8 JRE 镜像
FROM openjdk:8-jre-alpine FROM docker-registry.local:36000/base/openjdk:8-jre-alpine
# 设置工作目录 # 设置工作目录
WORKDIR /app WORKDIR /app

View File

@ -1,5 +1,5 @@
# 前端构建阶段 # 前端构建阶段
FROM registry.cn-beijing.aliyuncs.com/yinzy/node:20.11-alpine3.19 AS builder FROM docker-registry.local:36000/base/node:20.11-alpine3.19 AS builder
WORKDIR /app WORKDIR /app
@ -15,7 +15,7 @@ COPY vue-ui/ .
# RUN npm run build # RUN npm run build
# 运行阶段,使用独立 nginx 镜像 # 运行阶段,使用独立 nginx 镜像
FROM registry.cn-beijing.aliyuncs.com/yinzy/nginx:alpine-stable AS runtime FROM docker-registry.local:36000/base/nginx:alpine-stable AS runtime
# 清理默认页面 # 清理默认页面
WORKDIR /usr/share/nginx/html WORKDIR /usr/share/nginx/html