File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff line change 2222 - name : 设置Docker Buildx
2323 uses : docker/setup-buildx-action@v2
2424 with :
25- platforms : linux/amd64,linux/arm64 # 严格限制这两个
25+ platforms : linux/amd64,linux/arm64
2626
2727 - name : 登录 GitHub Container Registry
2828 uses : docker/login-action@v2
3232 password : ${{ secrets.GHCR_TOKEN }}
3333
3434 - name : 构建并推送多架构Docker镜像
35- uses : docker/build-push-action@v3 # 或者考虑升级到 v4 或 v5,如果可用
35+ uses : docker/build-push-action@v3
3636 with :
3737 context : .
38- platforms : linux/amd64,linux/arm64 # 严格与上面保持一致
38+ platforms : linux/amd64,linux/arm64
3939 push : true
4040 tags : ghcr.io/${{ github.repository_owner }}/vue-xiuxiangame:latest
Original file line number Diff line number Diff line change 11# 构建阶段
2- # 尝试使用 node:lts (长期支持版本) 或 node:20 (Node.js 20的默认Debian基础镜像)
32FROM node:lts AS build
4- # 或者 FROM node:20 AS build
53WORKDIR /app
64COPY . .
75RUN npm install && \
86npm run build
97
108# 运行阶段
11- # 保持与构建阶段一致
129FROM node:lts AS runtime
13- # 或者 FROM node:20 AS runtime
1410WORKDIR /app
1511COPY --from=build /app/dist /app
1612RUN npm install -g http-server
You can’t perform that action at this time.
0 commit comments