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
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:
parent
63559ba5f3
commit
f6e16fb8ed
2 changed files with 6 additions and 20 deletions
|
|
@ -200,7 +200,6 @@ jobs:
|
||||||
- name: Build frontend container image
|
- name: Build frontend container image
|
||||||
run: |
|
run: |
|
||||||
podman --remote build --no-cache \
|
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_HOST=${{ secrets.PROD_BACKEND_HOST }} \
|
||||||
--build-arg NEXT_PUBLIC_API_PORT=${{ secrets.PROD_BACKEND_PORT }} \
|
--build-arg NEXT_PUBLIC_API_PORT=${{ secrets.PROD_BACKEND_PORT }} \
|
||||||
-f frontend/Dockerfile \
|
-f frontend/Dockerfile \
|
||||||
|
|
|
||||||
|
|
@ -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 ----------
|
# ---------- build ----------
|
||||||
FROM docker.io/node:20-alpine AS builder
|
FROM docker.io/node:20-slim AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy production dependencies from deps stage
|
# Install dependencies with minimal footprint
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
|
||||||
|
|
||||||
# Copy package files
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
RUN npm cache clean --force && npm install --no-audit --no-fund --prefer-offline
|
||||||
# Install dev dependencies
|
|
||||||
RUN npm install --only=dev --no-audit --no-fund
|
|
||||||
|
|
||||||
# Copy app source
|
# Copy app source
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
@ -32,11 +19,11 @@ ENV NEXT_PUBLIC_API_HOST=${NEXT_PUBLIC_API_HOST}
|
||||||
ENV NEXT_PUBLIC_API_PORT=${NEXT_PUBLIC_API_PORT}
|
ENV NEXT_PUBLIC_API_PORT=${NEXT_PUBLIC_API_PORT}
|
||||||
|
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
# Clean up unnecessary files to save space after build
|
# Clean up to save space
|
||||||
RUN rm -rf node_modules .next/cache
|
RUN rm -rf node_modules .next/cache ~/.npm
|
||||||
|
|
||||||
# ---------- runner (standalone) ----------
|
# ---------- runner (standalone) ----------
|
||||||
FROM docker.io/node:20-alpine AS runner
|
FROM docker.io/node:20-slim AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# runtime env
|
# runtime env
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue