From 7cc157955dbe44656e292987a82a49d762e5f8d2 Mon Sep 17 00:00:00 2001 From: Dario Date: Mon, 11 Mar 2024 17:42:07 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20.env=20file=20in=20webapp=20Co-authore?= =?UTF-8?q?d-by:=20Gonzalo=20Su=C3=A1rez=20Losada=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 3 ++- webapp/Dockerfile | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 5419af36..297196b5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -33,8 +33,9 @@ services: container_name: webapp-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_en2b/webapp:latest profiles: [ "dev", "prod" ] - build: + args: + REACT_APP_API_ENDPOINT: ${API_URI} context: ./webapp environment: - REACT_APP_API_ENDPOINT=${API_URI} diff --git a/webapp/Dockerfile b/webapp/Dockerfile index cc71f38a..004d1482 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -9,6 +9,8 @@ RUN npm install #Create an optimized version of the webapp RUN npm run build RUN npm install serve +ARG REACT_APP_API_ENDPOINT +RUN echo "REACT_APP_API_ENDPOINT=$REACT_APP_API_ENDPOINT" > .env #Execute npm run prod to run the server CMD [ "npm", "run", "prod" ]