From cb31713307f811e633e137992a590642a869c47e Mon Sep 17 00:00:00 2001 From: Tiago Yamamoto Date: Sun, 28 Dec 2025 11:02:05 -0300 Subject: [PATCH] fix(docker): update frontend Dockerfile for Podman compatibility - Remove deprecated --only=production flag - Add default value for NEXT_PUBLIC_API_URL build arg - Add BuildKit cache mount for npm - Remove HEALTHCHECK (not supported by Podman OCI format) --- frontend/Dockerfile | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 16ba59e..c883232 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,6 +1,7 @@ # ============================================================================= # GoHorse Jobs Frontend - Optimized Production Dockerfile # ============================================================================= +# syntax=docker/dockerfile:1 # ----------------------------------------------------------------------------- # Stage 1: Dependencies @@ -9,10 +10,10 @@ FROM mirror.gcr.io/library/node:20-alpine AS deps WORKDIR /app -# Install dependencies only when needed +# Install ALL dependencies (dev + prod) for build stage COPY package.json package-lock.json* ./ -RUN npm ci --only=production --ignore-scripts && \ - npm cache clean --force +RUN --mount=type=cache,target=/root/.npm \ + npm ci && npm cache clean --force # ----------------------------------------------------------------------------- # Stage 2: Builder @@ -25,8 +26,8 @@ WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . -# Build arguments for environment -ARG NEXT_PUBLIC_API_URL +# Build arguments for environment (with sensible default) +ARG NEXT_PUBLIC_API_URL=http://localhost:8080 ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL # Build the application @@ -61,8 +62,4 @@ USER nextjs EXPOSE 3000 -# Health check -HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ - CMD wget -qO- http://localhost:3000 || exit 1 - CMD ["node", "server.js"]