From b478b1947cf80758787a4e46c8ed8b8b635824de Mon Sep 17 00:00:00 2001 From: Ruben Date: Mon, 11 Mar 2024 11:10:30 +0100 Subject: [PATCH] AB#26410 Make port ibf service port configurable locally --- docker-compose.override.yml | 6 +++--- example.env | 2 ++ interfaces/IBF-dashboard/src/environments/environment.ts | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 0de83a03cd..6592fc7111 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -2,11 +2,11 @@ version: '3.8' services: ibf-api-service: - command: ['npm', 'run', 'start:dev'] + command: [ 'npm', 'run', 'start:dev' ] environment: - NODE_ENV=development ports: - - 3000:3000 + - ${LOCAL_PORT_IBF_SERVICE}:3000 depends_on: - ibf-local-db networks: @@ -14,7 +14,7 @@ services: - api-network ibf-dashboard: - entrypoint: ['echo', 'Service ibf-dashboard disabled'] + entrypoint: [ 'echo', 'Service ibf-dashboard disabled' ] ibf-geoserver: ports: diff --git a/example.env b/example.env index f085eb83a7..9594846a1b 100644 --- a/example.env +++ b/example.env @@ -11,6 +11,8 @@ DB_PASSWORD= SECRET= RESET_SECRET= NODE_ENV= +LOCAL_PORT_IBF_SERVICE=4000 # If you do not specify a port, the default port is 3000. this only applies to the override docker-compose file + # Token used to acces the water point data at https://data.waterpointdata.org/profile/edit/developer_settings WATERPOINTDATA_TOKEN= # This password is only needed for production diff --git a/interfaces/IBF-dashboard/src/environments/environment.ts b/interfaces/IBF-dashboard/src/environments/environment.ts index 33ffb22662..4a3b14dd1b 100644 --- a/interfaces/IBF-dashboard/src/environments/environment.ts +++ b/interfaces/IBF-dashboard/src/environments/environment.ts @@ -4,7 +4,7 @@ export const environment = { configuration: 'development', - apiUrl: 'http://localhost:3000/api', // API + apiUrl: `http://localhost:${process.env['LOCAL_PORT_IBF_SERVICE'] ? process.env['LOCAL_PORT_IBF_SERVICE'] : 3000}/api`, // API useServiceWorker: false, // feature-flags geoserverUrl: 'http://localhost:8081/geoserver/ibf-system/wms', // geoserver ibfSystemVersion: 'v0.0.0', // version