diff --git a/Dockerfile b/Dockerfile index 2aca7dc..a95c233 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Build stage 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 WORKDIR /usr/src/app @@ -13,6 +17,10 @@ RUN npm install # Copy the rest of the application 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 RUN npm run build