From 427e7bd989da9c37949ba3e740bd70534f9a1444 Mon Sep 17 00:00:00 2001 From: Santiago Lo Coco Date: Wed, 25 Oct 2023 11:35:21 -0300 Subject: [PATCH] Expose only the API gateway --- .gitlab-ci.yml | 1 + auth-domain/docker-compose.yml | 10 ++++++++-- flights-domain/docker-compose.yml | 10 ++++++++-- gateway/docker-compose.yml | 17 ++++++++++++++++- gateway/src/api/config.py | 6 +++--- 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 69e5e1b..2980005 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,6 +36,7 @@ preparation: - echo "DOCKER_HUB_SCREEN_CLIENT_IMAGE=$DOCKER_HUB_USER/screens-client:${BUILD_ID}" >> context.env - echo "DOCKER_HUB_BROWSER_CLIENT_IMAGE=$DOCKER_HUB_USER/browser-client:${BUILD_ID}" >> context.env + - echo "DOCKER_HUB_GATEWAY_IMAGE=$DOCKER_HUB_USER/gateway:${BUILD_ID}" >> context.env - echo "DOCKER_HUB_USER_MANAGER_IMAGE=$DOCKER_HUB_USER/user-manager:${BUILD_ID}" >> context.env - echo "DOCKER_HUB_FLIGHT_INFO_IMAGE=$DOCKER_HUB_USER/flights-information:${BUILD_ID}" >> context.env diff --git a/auth-domain/docker-compose.yml b/auth-domain/docker-compose.yml index b0d7863..37180ad 100644 --- a/auth-domain/docker-compose.yml +++ b/auth-domain/docker-compose.yml @@ -4,8 +4,6 @@ services: usermanager-api: container_name: fids_usermanager_api image: ${API_IMAGE} - ports: - - 5001:5000 healthcheck: test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"] interval: 2s @@ -20,6 +18,8 @@ services: depends_on: usermanager-db: condition: service_healthy + networks: + - auth usermanager-db: container_name: fids_usermanager_db @@ -37,3 +37,9 @@ services: environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASS} + networks: + - auth + +networks: + auth: + driver: bridge \ No newline at end of file diff --git a/flights-domain/docker-compose.yml b/flights-domain/docker-compose.yml index 907b863..5722366 100644 --- a/flights-domain/docker-compose.yml +++ b/flights-domain/docker-compose.yml @@ -5,8 +5,6 @@ services: flights-api: container_name: fids_flights_api image: ${API_IMAGE} - ports: - - 5000:5000 healthcheck: test: ["CMD", "nc", "-vz", "-w1", "localhost", "5000"] interval: 2s @@ -21,6 +19,8 @@ services: depends_on: flights-api-db: condition: service_healthy + networks: + - flights flights-api-db: container_name: fids_flights_db @@ -38,3 +38,9 @@ services: environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASS} + networks: + - flights + +networks: + flights: + driver: bridge \ No newline at end of file diff --git a/gateway/docker-compose.yml b/gateway/docker-compose.yml index 6708fca..43c4f7a 100644 --- a/gateway/docker-compose.yml +++ b/gateway/docker-compose.yml @@ -5,6 +5,8 @@ services: api-gateway: container_name: fids_api_gateway image: ${API_IMAGE} + ports: + - 5000:5002 healthcheck: test: ["CMD", "nc", "-vz", "-w1", "localhost", "5002"] interval: 2s @@ -15,4 +17,17 @@ services: - TEST_TARGET=${TEST_TARGET} - PORT=5000 - APP_SETTINGS=${APP_SETTINGS} - network_mode: "host" + networks: + - auth + - flights + - gateway + +networks: + auth: + name: auth-domain_auth + external: true + flights: + name: flights-domain_flights + external: true + gateway: + driver: bridge \ No newline at end of file diff --git a/gateway/src/api/config.py b/gateway/src/api/config.py index a71b373..2d923ad 100644 --- a/gateway/src/api/config.py +++ b/gateway/src/api/config.py @@ -1,3 +1,3 @@ -API_USERS = "http://127.0.0.1:5001/users/" -API_FLIGHTS = "http://127.0.0.1:5000/flights/" -API_AUTH = "http://127.0.0.1:5001/auth/" +API_USERS = "http://fids_usermanager_api:5000/users/" +API_FLIGHTS = "http://fids_flights_api:5000/flights/" +API_AUTH = "http://fids_usermanager_api:5000/auth/"