From 3c2dee5b4a0eb6ebc1e11bdc3fee2237687ef010 Mon Sep 17 00:00:00 2001 From: "Kalana B. Thilakarathna" Date: Sun, 20 Sep 2026 16:51:13 +0530 Subject: [PATCH] Add build argument for NEXT_PUBLIC_API_URL in Dockerfile and CI/CD workflow --- .gitea/workflows/ci-cd.yml | 6 +++++- distribution_fe/Dockerfile | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 7375363..18de6e7 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -61,7 +61,11 @@ jobs: https://oauth2:${{ secrets.DISTRIBUTION }}@gitea.hexdive.com/New_REP_SYSTEM/ERP_Distribution.git \ . - name: Build Docker image - run: docker build --progress=plain --no-cache -t erpdistributionfe:latest ./distribution_fe + run: | + docker build --progress=plain --no-cache \ + --build-arg NEXT_PUBLIC_API_URL=https://distribution.hexdive.com/api \ + -t erpdistributionfe:latest \ + ./distribution_fe - name: Stop & remove existing container run: | docker stop erpdistributionfe 2>/dev/null || true diff --git a/distribution_fe/Dockerfile b/distribution_fe/Dockerfile index 64817f2..ae28f4d 100644 --- a/distribution_fe/Dockerfile +++ b/distribution_fe/Dockerfile @@ -7,6 +7,8 @@ FROM node:20-alpine AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . +ARG NEXT_PUBLIC_API_URL +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL RUN npm run build FROM node:20-alpine AS runner