From 762e25e29f92931960fb5d92dc857bcd29b9f774 Mon Sep 17 00:00:00 2001 From: Dario Date: Mon, 11 Mar 2024 18:31:31 +0100 Subject: [PATCH] =?UTF-8?q?chore:=20env=20variables=20Co-authored-by:=20Go?= =?UTF-8?q?nzalo=20Su=C3=A1rez=20Losada=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker-compose.yml | 5 +++++ webapp/Dockerfile | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 297196b5..1c1abf94 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -24,6 +24,11 @@ services: DATABASE_USER: ${DATABASE_USER} DATABASE_PASSWORD: ${DATABASE_PASSWORD} JWT_SECRET: ${JWT_SECRET} + environment: + - DATABASE_URL=jdbc:postgresql://WIQ_DB:5432/wiq + - DATABASE_USER=${DATABASE_USER} + - DATABASE_PASSWORD=${DATABASE_PASSWORD} + - JWT_SECRET=${JWT_SECRET} networks: - mynetwork ports: diff --git a/webapp/Dockerfile b/webapp/Dockerfile index 004d1482..08d1de31 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -6,11 +6,11 @@ WORKDIR /app #Install the dependencies RUN npm install +ARG REACT_APP_API_ENDPOINT +RUN echo "REACT_APP_API_ENDPOINT=$REACT_APP_API_ENDPOINT" > .env #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" ]