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" ]