fix(docker): update bun installation method in Dockerfile

This commit is contained in:
cfngc4594 2025-03-25 21:04:35 +08:00
parent d31edbaf08
commit d43b4b73b9

View File

@ -19,12 +19,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 ] || [ -f bun.lockb ]; then \ elif [ -f bun.lock ] || [ -f bun.lockb ]; then npm install -g bun && bun install --frozen-lockfile; \
apk add --no-cache curl bash && \
curl -fsSL https://bun.sh/install | bash && \
export BUN_INSTALL="$HOME/.bun" && \
export PATH="$BUN_INSTALL/bin:$PATH" && \
bun install --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \ else echo "Lockfile not found." && exit 1; \
fi fi
@ -43,12 +38,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 ] || [ -f bun.lockb ]; then \ elif [ -f bun.lock ] || [ -f bun.lockb ]; then npm install -g bun && bun run build; \
apk add --no-cache curl bash && \
curl -fsSL https://bun.sh/install | bash && \
export BUN_INSTALL="$HOME/.bun" && \
export PATH="$BUN_INSTALL/bin:$PATH" && \
bun run build; \
else echo "Lockfile not found." && exit 1; \ else echo "Lockfile not found." && exit 1; \
fi fi