From a3a69e0eaef9dd37f53a6f5a13fc69c79410275d Mon Sep 17 00:00:00 2001 From: nlevesque Date: Tue, 28 Jul 2026 14:20:09 +0200 Subject: [PATCH] Build with npm and ECR Public node image (dodge Docker Hub rate limits) Base images now come from public.ecr.aws instead of docker.io, whose anonymous pull quota kept failing Coolify builds. bun stays the local dev toolchain; the image build uses npm + the existing package-lock.json. --- Dockerfile | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index ded27c8..2881acf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,23 @@ +# Base image from AWS ECR Public (mirror of the Docker Official node image). +# Avoids Docker Hub's anonymous pull rate limits on build servers. +ARG NODE_IMAGE=public.ecr.aws/docker/library/node:22-alpine + # --- Build stage: install deps and build the Astro SSR bundle -FROM oven/bun:1-alpine AS build +FROM ${NODE_IMAGE} AS build WORKDIR /app -COPY package.json bun.lock ./ -RUN bun install --frozen-lockfile +COPY package.json package-lock.json ./ +RUN npm ci --ignore-scripts --no-audit --no-fund COPY . . -RUN bun run build +RUN npm run build # --- Deps stage: production-only node_modules for the runtime -FROM oven/bun:1-alpine AS deps +FROM ${NODE_IMAGE} AS deps WORKDIR /app -COPY package.json bun.lock ./ -RUN bun install --frozen-lockfile --production +COPY package.json package-lock.json ./ +RUN npm ci --omit=dev --ignore-scripts --no-audit --no-fund # --- Runtime stage: Astro Node standalone server -FROM node:22-alpine +FROM ${NODE_IMAGE} WORKDIR /app ENV NODE_ENV=production \ HOST=0.0.0.0 \