This is a Docker (with docker-compose) environment for Microservices Federation Project. Is a example that how we can to federate multiples microservices using Apollo Federation. Each schema in each microservice works independently. With Apollo Federation they are combine into a single graph.
- First, clone this repository:
git clone https://github.com/nietzscheson/microservices-federation
- Init project
make
- Show containers:
make ps
This results in the following running containers:
docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------
gateway docker-entrypoint.sh /bin/ ... Up 0.0.0.0:4000->80/tcp
order sh ./entrypoint.sh flask r ... Up (healthy) 0.0.0.0:5003->5000/tcp
product sh ./entrypoint.sh flask r ... Up (healthy) 0.0.0.0:5002->5000/tcp
user sh ./entrypoint.sh flask r ... Up (healthy) 0.0.0.0:5001->5000/tcp
The microservices are running in:
- APIGateway: localhost:4000/graphql
- User API: localhost:5000/graphql
- Product API: localhost:5001/graphql
- Order API: localhost:5002/graphql
- Run test:
make test