Hi everyone, I’m a new user.
In my docker-compose.yaml file I have two microservices:
version: '3'
x-common-settings: &common-settings
restart: on-failure
services:
user-service:
<<: *common-settings
container_name: user-service
build: ./user-service
ports:
- 8081:8080
purchase-service:
<<: *common-settings
container_name: purchase-service
build: ./purchase-service
ports:
- 8082:8080
At this moment, if I want to test my APIs, I have to go to localhost:8081/hello for microservice1 and to localhost:8082/hello for microservice2.
Instead, i would test my APIs going to localhost/users/hello and localhost/purchases/hello, using the same port (8080). How could I do it? Thanks in advance.
I read on the web that the solution is Traefik, but trying to emulate the example in the documentation I was unable to get it to work properly.