Add build argument for NEXT_PUBLIC_API_URL in Dockerfile and CI/CD workflow
This commit is contained in:
@@ -61,7 +61,11 @@ jobs:
|
|||||||
https://oauth2:${{ secrets.DISTRIBUTION }}@gitea.hexdive.com/New_REP_SYSTEM/ERP_Distribution.git \
|
https://oauth2:${{ secrets.DISTRIBUTION }}@gitea.hexdive.com/New_REP_SYSTEM/ERP_Distribution.git \
|
||||||
.
|
.
|
||||||
- name: Build Docker image
|
- 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
|
- name: Stop & remove existing container
|
||||||
run: |
|
run: |
|
||||||
docker stop erpdistributionfe 2>/dev/null || true
|
docker stop erpdistributionfe 2>/dev/null || true
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ FROM node:20-alpine AS builder
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --from=deps /app/node_modules ./node_modules
|
COPY --from=deps /app/node_modules ./node_modules
|
||||||
COPY . .
|
COPY . .
|
||||||
|
ARG NEXT_PUBLIC_API_URL
|
||||||
|
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM node:20-alpine AS runner
|
FROM node:20-alpine AS runner
|
||||||
|
|||||||
Reference in New Issue
Block a user