Use mirror.gcr.io for Docker base images to avoid Docker Hub rate limits
All checks were successful
Build and Push / build (push) Successful in 44s
All checks were successful
Build and Push / build (push) Successful in 44s
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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`)
|
||||
|
||||
Reference in New Issue
Block a user