From 4c6d7a0849e873404906b35e275bf1e1e973827e Mon Sep 17 00:00:00 2001 From: sergiollende Date: Mon, 29 Apr 2024 00:29:17 +0200 Subject: [PATCH] more changes --- docker-compose.yml | 7 ++++++- webapp/Dockerfile | 1 - webapp/package.json | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0d37a80..34be453 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -56,7 +56,12 @@ services: container_name: webapp-${teamname:-defaultASW} image: ghcr.io/arquisoft/wiq_en3a/webapp:latest profiles: ["dev", "prod"] - build: ./webapp + build: + args: + REACT_APP_API_ENDPOINT: ${API_URI} + context: ./webapp + environment: + - REACT_APP_API_ENDPOINT=${API_URI} depends_on: - gatewayservice ports: diff --git a/webapp/Dockerfile b/webapp/Dockerfile index e70d91b..4865006 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -8,7 +8,6 @@ RUN npm install ARG API_URI="http://localhost:8000" ENV REACT_APP_API_ENDPOINT=$API_URI -ENV PORT=3000 #Create an optimized version of the webapp RUN npm run build diff --git a/webapp/package.json b/webapp/package.json index d5c4cdb..cb5ddbd 100644 --- a/webapp/package.json +++ b/webapp/package.json @@ -33,9 +33,9 @@ "zustand": "^4.5.2" }, "scripts": { - "start": "set PORT=3000 && set HTTP=true && react-scripts start", - "build": "set PORT=3000 && set HTTP=true && react-scripts build", - "prod": "serve -s build -l 3000", + "start": "set HTTP=true && react-scripts start", + "build": "set HTTP=true && react-scripts build", + "prod": "serve -s build", "test": "react-scripts test --transformIgnorePatterns 'node_modules/(?!axios)/'", "test:e2e": "cross-env START_SERVER_AND_TEST_INSECURE=1 PORT=3000 npm run rune2etests", "rune2etests": "start-server-and-test 'node e2e/test-environment-setup.js' http://localhost:8000/health prod 3000 \"cd e2e && jest\"",