Use mirror.gcr.io for Docker base images to avoid Docker Hub rate limits

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-15 15:07:57 +01:00
parent a7244406fd
commit 07abb8f881
2 changed files with 5 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
# ---- Stage 1: Build frontend ----
FROM node:22-alpine AS frontend-build
FROM mirror.gcr.io/library/node:22-alpine AS frontend-build
WORKDIR /app/frontend
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
@@ -7,7 +7,7 @@ COPY frontend/ ./
RUN npx vite build
# ---- Stage 2: Build Go backend ----
FROM golang:1.26-alpine AS backend-build
FROM mirror.gcr.io/library/golang:1.26-alpine AS backend-build
WORKDIR /app/backend
COPY backend/go.mod backend/go.sum ./
RUN go mod download
@@ -15,7 +15,7 @@ COPY backend/ ./
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /server ./cmd/server
# ---- Stage 3: Runtime ----
FROM alpine:3.21
FROM mirror.gcr.io/library/alpine:3.21
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app

View File

@@ -776,6 +776,8 @@ This allows hot-reload development while the Go backend handles API and WebSocke
The Dockerfile uses three stages for a minimal production image:
All base images are pulled from `mirror.gcr.io` (Google's public Docker Hub mirror) to avoid Docker Hub rate limits.
**Stage 1 -- Frontend build** (Node 22 Alpine):
- Installs npm dependencies (`npm ci`)
- Builds React app with Vite (`npx vite build`)