mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Merge pull request #89 from hamster1963/perf-docker-build
perf: docker build
This commit is contained in:
commit
ffbd9c5201
9
.github/workflows/Deploy.yml
vendored
9
.github/workflows/Deploy.yml
vendored
@ -18,11 +18,14 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
# 移除 QEMU 设置步骤,因为我们不再需要模拟
|
||||
# - name: Set up QEMU
|
||||
# uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver-opts: network=host
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
@ -56,6 +59,8 @@ jobs:
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=${{ env.REGISTRY_IMAGE }}:cache
|
||||
cache-to: type=inline
|
||||
|
||||
changelog:
|
||||
name: Generate Changelog
|
||||
|
@ -1,17 +1,17 @@
|
||||
FROM oven/bun:1 AS base
|
||||
FROM --platform=$BUILDPLATFORM oven/bun:1 AS base
|
||||
|
||||
# Stage 1: Install dependencies
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
COPY package.json bun.lockb ./
|
||||
RUN bun install --frozen-lockfile
|
||||
RUN --mount=type=cache,target=/root/.bun bun install --frozen-lockfile
|
||||
|
||||
# Stage 2: Build the application
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN bun run build
|
||||
RUN --mount=type=cache,target=/root/.bun bun run build
|
||||
|
||||
# Stage 3: Production image
|
||||
FROM oven/bun:1-alpine AS runner
|
||||
|
Loading…
Reference in New Issue
Block a user