This commit is contained in:
@ -1,6 +1,10 @@
|
|||||||
# Build stage
|
# Build stage
|
||||||
FROM node:20.11 as builder
|
FROM node:20.11 as builder
|
||||||
|
|
||||||
|
# Build arguments for React environment variables
|
||||||
|
ARG REACT_APP_API_AUTH
|
||||||
|
ARG REACT_APP_API_BLOG
|
||||||
|
|
||||||
# Set working directory
|
# Set working directory
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
@ -13,6 +17,10 @@ RUN npm install
|
|||||||
# Copy the rest of the application
|
# Copy the rest of the application
|
||||||
COPY . ./
|
COPY . ./
|
||||||
|
|
||||||
|
# Set env vars for React build (only works if passed as build-arg)
|
||||||
|
ENV REACT_APP_API_AUTH=$REACT_APP_API_AUTH
|
||||||
|
ENV REACT_APP_API_BLOG=$REACT_APP_API_BLOG
|
||||||
|
|
||||||
# Build the application
|
# Build the application
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user