Use slimmer node base image
Some checks failed
Podman Rootless Demo / test-backend (push) Has been skipped
Podman Rootless Demo / test-frontend (push) Successful in 11s
Podman Rootless Demo / build-backend (push) Has been skipped
Podman Rootless Demo / build-frontend (push) Failing after 57s
Podman Rootless Demo / deploy-prod (push) Has been skipped

This commit is contained in:
continuist 2025-09-21 13:29:08 -04:00
parent 63559ba5f3
commit f6e16fb8ed
2 changed files with 6 additions and 20 deletions

View file

@ -200,7 +200,6 @@ jobs:
- name: Build frontend container image
run: |
podman --remote build --no-cache \
--storage-opt overlay.mountopt=size=20G \
--build-arg NEXT_PUBLIC_API_HOST=${{ secrets.PROD_BACKEND_HOST }} \
--build-arg NEXT_PUBLIC_API_PORT=${{ secrets.PROD_BACKEND_PORT }} \
-f frontend/Dockerfile \

View file

@ -1,23 +1,10 @@
# ---------- deps ----------
FROM docker.io/node:20-alpine AS deps
WORKDIR /app
# Install only dependencies first
COPY package*.json ./
RUN npm install --production --no-audit --no-fund
# ---------- build ----------
FROM docker.io/node:20-alpine AS builder
FROM docker.io/node:20-slim AS builder
WORKDIR /app
# Copy production dependencies from deps stage
COPY --from=deps /app/node_modules ./node_modules
# Copy package files
# Install dependencies with minimal footprint
COPY package*.json ./
# Install dev dependencies
RUN npm install --only=dev --no-audit --no-fund
RUN npm cache clean --force && npm install --no-audit --no-fund --prefer-offline
# Copy app source
COPY . .
@ -32,11 +19,11 @@ ENV NEXT_PUBLIC_API_HOST=${NEXT_PUBLIC_API_HOST}
ENV NEXT_PUBLIC_API_PORT=${NEXT_PUBLIC_API_PORT}
RUN npm run build
# Clean up unnecessary files to save space after build
RUN rm -rf node_modules .next/cache
# Clean up to save space
RUN rm -rf node_modules .next/cache ~/.npm
# ---------- runner (standalone) ----------
FROM docker.io/node:20-alpine AS runner
FROM docker.io/node:20-slim AS runner
WORKDIR /app
# runtime env