From 7a67de7b49b53ab7f00ae2b3eed910f529dfc450 Mon Sep 17 00:00:00 2001 From: Z8MB1E Date: Mon, 18 May 2026 00:09:43 -0400 Subject: [PATCH] chore: update Dockerfile to streamline dependency installation and add FontAwesome token support --- Dockerfile | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index f524fe7..bdee9d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,15 +9,16 @@ FROM base AS deps RUN apk add --no-cache libc6-compat WORKDIR /app +ARG FONTAWESOME_PACKAGE_TOKEN + # Install dependencies based on the preferred package manager -COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* bun.lock* ./ +COPY package.json bun.lock* ./ RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ - elif [ -f package-lock.json ]; then npm ci; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ - elif [ -f bun.lock ]; then bun install --frozen-lockfile; \ - else echo "Lockfile not found." && exit 1; \ - fi + if [ -n "$FONTAWESOME_PACKAGE_TOKEN" ]; then \ + printf "@fortawesome:registry=https://npm.fontawesome.com/\n@awesome.me:registry=https://npm.fontawesome.com/\n//npm.fontawesome.com/:_authToken=%s\n" "$FONTAWESOME_PACKAGE_TOKEN" > .npmrc; \ + fi; \ + bun install --frozen-lockfile; \ + rm -f .npmrc # Rebuild the source code only when needed @@ -31,13 +32,7 @@ COPY . . # Uncomment the following line in case you want to disable telemetry during the build. # ENV NEXT_TELEMETRY_DISABLED 1 -RUN \ - if [ -f yarn.lock ]; then yarn 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 bun.lock ]; then bun run build; \ - else echo "Lockfile not found." && exit 1; \ - fi +RUN bun run build # Production image, copy all the files and run next FROM base AS runner