Compare commits

...

8 Commits

Author SHA1 Message Date
646d615e76 fix(gatekeeper): ensure public directory exists in Dockerfile to prevent COPY failure
All checks were successful
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m29s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m28s
Monorepo Pipeline / 🐳 Build & Push Images (push) Successful in 7m4s
2026-02-04 22:15:44 +01:00
51409099fc feat: Increase registry pruning aggressiveness by reducing tag retention, adding version and buildcache tag deletion, and shortening Docker system prune duration. (includes chore: relax header-max-length)
Some checks failed
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m33s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m30s
Monorepo Pipeline / 🐳 Build & Push Images (push) Failing after 6m38s
2026-02-04 18:43:33 +01:00
22cd20e639 fix: build workspace dependencies before gatekeeper in Docker 2026-02-04 18:39:12 +01:00
e7cc1c8ca5 fix: stabilize Docker builds by standardizing on ARM64 and explicit stage naming (klz-2026 pattern)
Some checks failed
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m42s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m29s
Monorepo Pipeline / 🐳 Build & Push Images (push) Failing after 4m9s
2026-02-04 18:13:54 +01:00
0ccb15a929 refactor: restructure Dockerfile.gatekeeper into base, builder, and runner stages for improved multi-stage build. 2026-02-04 12:10:51 +01:00
a94ddcfbb2 refactor: rename Dockerfile build stage from base to builder
Some checks failed
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m28s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m49s
Monorepo Pipeline / 🐳 Build & Push Images (push) Failing after 23m39s
2026-02-04 01:35:45 +01:00
d3a9af140c feat: add script to prune Docker registry tags, perform garbage collection, and prune host Docker resources. 2026-02-04 01:01:00 +01:00
0dc3ba0da4 chore: Reorder pnpm build arguments in Dockerfile.nextjs.
Some checks failed
Monorepo Pipeline / 🧪 Quality Assurance (push) Successful in 2m30s
Monorepo Pipeline / 🚀 Release (push) Successful in 2m31s
Monorepo Pipeline / 🐳 Build & Push Images (push) Failing after 25m10s
2026-02-03 22:40:10 +01:00
6 changed files with 83 additions and 22 deletions

View File

@@ -104,7 +104,8 @@ jobs:
with: with:
context: . context: .
file: packages/infra/docker/Dockerfile.nextjs file: packages/infra/docker/Dockerfile.nextjs
platforms: linux/amd64,linux/arm64 platforms: linux/arm64
pull: true
push: true push: true
secrets: | secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }} NPM_TOKEN=${{ secrets.NPM_TOKEN }}
@@ -117,7 +118,8 @@ jobs:
with: with:
context: . context: .
file: packages/infra/docker/Dockerfile.runtime file: packages/infra/docker/Dockerfile.runtime
platforms: linux/amd64,linux/arm64 platforms: linux/arm64
pull: true
push: true push: true
secrets: | secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }} NPM_TOKEN=${{ secrets.NPM_TOKEN }}
@@ -130,7 +132,8 @@ jobs:
with: with:
context: . context: .
file: packages/infra/docker/Dockerfile.gatekeeper file: packages/infra/docker/Dockerfile.gatekeeper
platforms: linux/amd64,linux/arm64 platforms: linux/arm64
pull: true
push: true push: true
secrets: | secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }} NPM_TOKEN=${{ secrets.NPM_TOKEN }}
@@ -143,7 +146,8 @@ jobs:
with: with:
context: . context: .
file: packages/infra/docker/Dockerfile.directus file: packages/infra/docker/Dockerfile.directus
platforms: linux/amd64,linux/arm64 platforms: linux/arm64
pull: true
push: true push: true
secrets: | secrets: |
NPM_TOKEN=${{ secrets.NPM_TOKEN }} NPM_TOKEN=${{ secrets.NPM_TOKEN }}

View File

@@ -1,7 +1,7 @@
const config = { const config = {
extends: ["@commitlint/config-conventional"], extends: ["@commitlint/config-conventional"],
rules: { rules: {
"header-max-length": [2, "always", 150], "header-max-length": [2, "always", 250],
"subject-case": [0], "subject-case": [0],
"subject-full-stop": [0], "subject-full-stop": [0],
}, },

View File

@@ -1,14 +1,10 @@
FROM node:20-alpine AS base # Step 1: Builder stage
FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat curl RUN apk add --no-cache libc6-compat curl
WORKDIR /app WORKDIR /app
# Enable pnpm
RUN corepack enable pnpm RUN corepack enable pnpm
# Step 2: Install dependencies # Copy source (honoring .dockerignore)
# We copy everything first because we have a .dockerignore
# and we need the workspace structure for pnpm to work correctly
COPY . . COPY . .
# Use a secret for NPM_TOKEN to authenticate with private registry # Use a secret for NPM_TOKEN to authenticate with private registry
@@ -17,14 +13,13 @@ RUN --mount=type=cache,target=/root/.local/share/pnpm/store/v3 \
export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) && \ export NPM_TOKEN=$(cat /run/secrets/NPM_TOKEN) && \
pnpm i --frozen-lockfile pnpm i --frozen-lockfile
# Copy source # Build Gatekeeper and its dependencies
COPY . . RUN pnpm --filter @mintel/gatekeeper... build
RUN mkdir -p packages/gatekeeper/public
# Build Gatekeeper # Step 2: Runner stage
RUN pnpm --filter @mintel/gatekeeper build FROM node:20-alpine AS runner
RUN apk add --no-cache libc6-compat curl
# Runner
FROM base AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs RUN addgroup --system --gid 1001 nodejs

View File

@@ -1,5 +1,5 @@
# Step 1: Base image # Step 1: Builder image
FROM node:20-alpine AS base FROM node:20-alpine AS builder
RUN apk add --no-cache libc6-compat curl RUN apk add --no-cache libc6-compat curl
WORKDIR /app WORKDIR /app
RUN corepack enable pnpm RUN corepack enable pnpm
@@ -16,4 +16,4 @@ RUN --mount=type=cache,target=/root/.local/share/pnpm/store/v3 \
pnpm i --frozen-lockfile pnpm i --frozen-lockfile
# Step 3: Build shared packages # Step 3: Build shared packages
RUN pnpm -r build --filter="./packages/*" RUN pnpm --filter "./packages/*" -r build

View File

@@ -194,7 +194,9 @@ jobs:
uses: docker/build-push-action@v5 uses: docker/build-push-action@v5
with: with:
context: . context: .
file: packages/infra/docker/Dockerfile.nextjs
platforms: linux/arm64 platforms: linux/arm64
pull: true
build-args: | build-args: |
NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_base_url }} NEXT_PUBLIC_BASE_URL=${{ needs.prepare.outputs.next_public_base_url }}
NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }} NEXT_PUBLIC_TARGET=${{ needs.prepare.outputs.target }}

View File

@@ -0,0 +1,60 @@
#!/bin/bash
set -e
# Configuration
REGISTRY_DATA="/opt/infra/registry/data/docker/registry/v2"
KEEP_TAGS=3
echo "🏥 Starting Aggressive Registry & Docker Maintenance..."
# 1. Prune Registry Tags (Filesystem level)
for repo_dir in "$REGISTRY_DATA/repositories/mintel/"*; do
repo_name=$(basename "$repo_dir")
tags_dir="$repo_dir/_manifests/tags"
if [ -d "$tags_dir" ]; then
echo "🔍 Processing repository: mintel/$repo_name"
# Prune main-* tags
echo " 📦 Pruning main tags..."
main_tags=$(ls -dt "$tags_dir"/main-* 2>/dev/null || true)
count=0
for tag_path in $main_tags; do
((++count))
if [ $count -gt $KEEP_TAGS ]; then
echo " 🗑️ Deleting old main tag: $(basename "$tag_path")"
rm -rf "$tag_path"
fi
done
# Prune version tags (v* and rc*)
echo " 🏷️ Pruning version tags..."
version_tags=$(ls -dt "$tags_dir"/v1* 2>/dev/null || true)
count=0
for tag_path in $version_tags; do
((++count))
if [ $count -gt $KEEP_TAGS ]; then
echo " 🗑️ Deleting old version tag: $(basename "$tag_path")"
rm -rf "$tag_path"
fi
done
# Always prune buildcache (as it rebuilds quickly)
if [ -d "$tags_dir/buildcache" ]; then
echo " 🧹 Deleting buildcache tag"
rm -rf "$tags_dir/buildcache"
fi
fi
done
# 2. Run Garbage Collection
echo "♻️ Running Registry Garbage Collection..."
docker exec registry-registry-1 bin/registry garbage-collect /etc/docker/registry/config.yml
# 3. Prune Host Docker resources (Shorter window: 24h)
echo "🧹 Pruning Host Docker resources..."
docker system prune -af --filter "until=24h"
docker volume prune -f
echo "✅ Maintenance complete!"
df -h /