Fix base image: use mirror direct path, switch to node:20-alpine
deploy / deploy (push) Failing after 7m35s
deploy / deploy (push) Failing after 7m35s
Mirror exposes images as mirror.soroushasadi.com/<image> directly, not via /repository/docker-group/ path. Also node:20-alpine is already cached on the server; node:20-slim was never pulled. Dockerfile: apk instead of apt-get, addgroup/adduser instead of groupadd/useradd (Alpine BusyBox compatibility). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -30,7 +30,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Docker Build Test
|
- name: Docker Build Test
|
||||||
env:
|
env:
|
||||||
NODE_IMAGE: mirror.soroushasadi.com/repository/docker-group/node:20-slim
|
NODE_IMAGE: mirror.soroushasadi.com/node:20-alpine
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
docker build \
|
docker build \
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Build Container
|
- name: Build Container
|
||||||
env:
|
env:
|
||||||
NODE_IMAGE: mirror.soroushasadi.com/repository/docker-group/node:20-slim
|
NODE_IMAGE: mirror.soroushasadi.com/node:20-alpine
|
||||||
run: |
|
run: |
|
||||||
docker compose build
|
docker compose build
|
||||||
|
|
||||||
|
|||||||
+6
-11
@@ -1,19 +1,14 @@
|
|||||||
# All base images flow through the Nexus docker-group proxy, which aggregates
|
# Base image pulled from the Nexus mirror (direct path, no /repository/ prefix).
|
||||||
# Docker Hub, Microsoft Container Registry (mcr.microsoft.com) and GitHub
|
# Override for a local build: --build-arg NODE_IMAGE=node:20-alpine
|
||||||
# Container Registry (ghcr.io) behind one path — any upstream image is reachable
|
ARG NODE_IMAGE=mirror.soroushasadi.com/node:20-alpine
|
||||||
# as mirror.soroushasadi.com/repository/docker-group/<image>.
|
|
||||||
# Build directly against Docker Hub instead with:
|
|
||||||
# --build-arg NODE_IMAGE=node:20-slim
|
|
||||||
ARG NODE_IMAGE=mirror.soroushasadi.com/repository/docker-group/node:20-slim
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# 1. Dependencies — installs node_modules and compiles the better-sqlite3
|
# 1. Dependencies — installs node_modules and compiles the better-sqlite3
|
||||||
# native addon (needs python3 + a C++ toolchain).
|
# native addon (needs python3 + a C++ toolchain).
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
FROM ${NODE_IMAGE} AS deps
|
FROM ${NODE_IMAGE} AS deps
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apt-get update \
|
RUN apk add --no-cache python3 make g++ ca-certificates
|
||||||
&& apt-get install -y --no-install-recommends python3 make g++ ca-certificates \
|
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
# .npmrc points npm at the Nexus npm-group; NPM_TOKEN (optional) authenticates.
|
# .npmrc points npm at the Nexus npm-group; NPM_TOKEN (optional) authenticates.
|
||||||
# The token is appended at build time only — never reaches the runner image.
|
# The token is appended at build time only — never reaches the runner image.
|
||||||
ARG NPM_TOKEN=""
|
ARG NPM_TOKEN=""
|
||||||
@@ -45,7 +40,7 @@ ENV NODE_ENV=production \
|
|||||||
HOSTNAME=0.0.0.0 \
|
HOSTNAME=0.0.0.0 \
|
||||||
DATA_DIR=/data
|
DATA_DIR=/data
|
||||||
|
|
||||||
RUN groupadd -g 1001 nodejs && useradd -u 1001 -g nodejs -m nextjs
|
RUN addgroup -g 1001 nodejs && adduser -u 1001 -G nodejs -h /home/nextjs -D nextjs
|
||||||
|
|
||||||
# Standalone server, static assets, and the public/ tree (portfolio art etc.).
|
# Standalone server, static assets, and the public/ tree (portfolio art etc.).
|
||||||
COPY --from=builder /app/.next/standalone ./
|
COPY --from=builder /app/.next/standalone ./
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ services:
|
|||||||
context: .
|
context: .
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
args:
|
args:
|
||||||
NODE_IMAGE: ${NODE_IMAGE:-mirror.soroushasadi.com/repository/docker-group/node:20-slim}
|
NODE_IMAGE: ${NODE_IMAGE:-mirror.soroushasadi.com/node:20-alpine}
|
||||||
NPM_TOKEN: ${NPM_TOKEN:-}
|
NPM_TOKEN: ${NPM_TOKEN:-}
|
||||||
image: soroushasadi-site:latest
|
image: soroushasadi-site:latest
|
||||||
container_name: soroushasadi-site
|
container_name: soroushasadi-site
|
||||||
|
|||||||
Reference in New Issue
Block a user