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.
This commit is contained in:
2026-07-28 14:20:09 +02:00
parent fee2155a18
commit a3a69e0eae
+12 -8
View File
@@ -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 \