mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Merge pull request #19 from hamster1963/docker-platform
[TSK1-489]Docker platform
This commit is contained in:
commit
b02a8604be
9
.github/workflows/Deploy.yml
vendored
9
.github/workflows/Deploy.yml
vendored
@ -13,6 +13,12 @@ jobs:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
@ -38,9 +44,10 @@ jobs:
|
||||
type=ref,event=tag
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
|
17
Dockerfile
17
Dockerfile
@ -1,22 +1,11 @@
|
||||
FROM node:21-alpine AS base
|
||||
FROM oven/bun:1 AS base
|
||||
|
||||
FROM base AS deps
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk --no-cache add ca-certificates wget
|
||||
RUN wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
|
||||
RUN wget https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.28-r0/glibc-2.28-r0.apk
|
||||
RUN apk add --no-cache --force-overwrite glibc-2.28-r0.apk
|
||||
|
||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* bun.lockb* ./
|
||||
RUN \
|
||||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||
elif [ -f package-lock.json ]; then npm ci; \
|
||||
elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i --frozen-lockfile; \
|
||||
elif [ -f bun.lockb ]; then npm install -g bun && bun install; \
|
||||
else echo "Lockfile not found." && exit 1; \
|
||||
fi
|
||||
RUN bun install
|
||||
|
||||
|
||||
FROM base AS builder
|
||||
@ -25,7 +14,7 @@ COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
|
||||
RUN yarn build
|
||||
RUN bun run build
|
||||
|
||||
|
||||
FROM base AS runner
|
||||
|
@ -6,7 +6,6 @@ import { error } from "console";
|
||||
import { unstable_noStore as noStore } from "next/cache";
|
||||
import getEnv from "./env-entry";
|
||||
|
||||
|
||||
export async function GetNezhaData() {
|
||||
noStore();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user