From aa22b487466464ca412417c1630105ae32c57d93 Mon Sep 17 00:00:00 2001 From: Eden Kirin Date: Tue, 23 Jan 2024 22:55:21 +0100 Subject: [PATCH] Frontend env arguments --- docker-compose-local.yml | 5 +++-- docker-compose.yml | 5 +++-- frontend/Dockerfile | 6 ++++++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docker-compose-local.yml b/docker-compose-local.yml index 5aa1d64..583f6f6 100644 --- a/docker-compose-local.yml +++ b/docker-compose-local.yml @@ -58,8 +58,9 @@ services: build: context: ./frontend dockerfile: Dockerfile + args: + - REACT_APP_MACHINES_API_URL=http://localhost:10000 + - REACT_APP_PRODUCTS_API_URL=http://localhost:10000 network_mode: "host" - environment: - - REACT_APP_BACKEND_API_URL="http://localhost:10000" depends_on: - proxy diff --git a/docker-compose.yml b/docker-compose.yml index 057549b..5879528 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,10 +69,11 @@ services: build: context: ./frontend dockerfile: Dockerfile + args: + - REACT_APP_MACHINES_API_URL=http://localhost:10000 + - REACT_APP_PRODUCTS_API_URL=http://localhost:10000 networks: - frontend-net - environment: - - REACT_APP_BACKEND_API_URL="http://localhost:10000" ports: - "8080:80" depends_on: diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 44afcdf..e379901 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -3,6 +3,12 @@ FROM node:21 as node-builder WORKDIR /node-builder +ARG REACT_APP_MACHINES_API_URL +ARG REACT_APP_PRODUCTS_API_URL + +ENV REACT_APP_MACHINES_API_URL $REACT_APP_MACHINES_API_URL +ENV REACT_APP_PRODUCTS_API_URL $REACT_APP_PRODUCTS_API_URL + COPY ./package.json . COPY ./package-lock.json . COPY ./public ./public