feat(dockerfile): support bun.lockb file

This commit is contained in:
cfngc4594 2025-03-05 16:23:10 +08:00
parent 4e1a185036
commit f4ce0e594d

View File

@ -16,7 +16,7 @@ RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \ elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
elif [ -f bun.lock ]; then \ elif [ -f bun.lock ] || [ -f bun.lockb ]; then \
apk add --no-cache curl bash && \ apk add --no-cache curl bash && \
curl -fsSL https://bun.sh/install | bash && \ curl -fsSL https://bun.sh/install | bash && \
export BUN_INSTALL="$HOME/.bun" && \ export BUN_INSTALL="$HOME/.bun" && \
@ -25,7 +25,6 @@ RUN \
else echo "Lockfile not found." && exit 1; \ else echo "Lockfile not found." && exit 1; \
fi fi
# Rebuild the source code only when needed # Rebuild the source code only when needed
FROM base AS builder FROM base AS builder
WORKDIR /app WORKDIR /app
@ -41,7 +40,7 @@ RUN \
if [ -f yarn.lock ]; then yarn run build; \ if [ -f yarn.lock ]; then yarn run build; \
elif [ -f package-lock.json ]; then npm run build; \ elif [ -f package-lock.json ]; then npm run build; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
elif [ -f bun.lock ]; then \ elif [ -f bun.lock ] || [ -f bun.lockb ]; then \
apk add --no-cache curl bash && \ apk add --no-cache curl bash && \
curl -fsSL https://bun.sh/install | bash && \ curl -fsSL https://bun.sh/install | bash && \
export BUN_INSTALL="$HOME/.bun" && \ export BUN_INSTALL="$HOME/.bun" && \