feat: 添加对linux/arm/v7平台的支持,优化Docker构建配置
This commit is contained in:
@@ -36,7 +36,7 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: false
|
||||
tags: |
|
||||
katelyatv:latest
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
platforms: linux/amd64,linux/arm64
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
push: true
|
||||
tags: |
|
||||
ghcr.io/${{ github.repository_owner }}/katelyatv:latest
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
- name: Test Summary
|
||||
run: |
|
||||
echo "✅ Docker build completed successfully!"
|
||||
echo "📦 Multi-platform support: linux/amd64, linux/arm64"
|
||||
echo "📦 Multi-platform support: linux/amd64, linux/arm64, linux/arm/v7"
|
||||
echo "🔄 Cache optimization enabled"
|
||||
if [ "${{ github.event_name }}" != "pull_request" ] && [ "${{ github.ref }}" == "refs/heads/main" ]; then
|
||||
echo "🚀 Images pushed to GitHub Container Registry"
|
||||
|
||||
@@ -30,6 +30,7 @@ jobs:
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
- linux/arm/v7
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -9,6 +9,9 @@ WORKDIR /app
|
||||
# 仅复制依赖清单,提高构建缓存利用率
|
||||
COPY package.json pnpm-lock.yaml ./
|
||||
|
||||
# 针对ARM架构优化:设置更大的内存限制和超时时间
|
||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||||
|
||||
# 安装所有依赖(含 devDependencies,后续会裁剪)
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
@@ -17,6 +20,9 @@ FROM --platform=$BUILDPLATFORM node:20-alpine AS builder
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
WORKDIR /app
|
||||
|
||||
# 针对ARM架构优化:设置更大的内存限制
|
||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||||
|
||||
# 复制依赖
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
# 复制全部源代码
|
||||
|
||||
Reference in New Issue
Block a user