- Docker
- Kubernetes
- Docker
- Docker Compose
- Adding Hosts to /etc/hosts:
127.0.0.1 mymicroservices.com
-
Kubernetes (if you want to scale the application)
-
For Ubuntu, Kubernetes can be easily installed using MicroK8s
-
It is necessary to install the following plugins on Kubernetes or MicroK8s:
- cert-manager (certificate manager for TLS)
- nginx-ingress-controller (ingress-controller for service routes within Kubernetes)
-
-
Portainer - Container manager for both Docker and Kubernetes
Build Docker containers for the services by navigating to the service folders containing the Dockerfile and running the command:
docker build --no-cache -t authentications:latest .
docker build --no-cache -t carts:latest .
docker build --no-cache -t customers:latest .
docker build --no-cache -t emails:latest .
docker build --no-cache -t orders:latest .
docker build --no-cache -t payments:latest .
docker build --no-cache -t products:latest .
docker build --no-cache -t web:latest .
In the infra project folder, navigate to the monitoring folder. In this folder, you'll find the following files:
- docker-compose.dev.yml (development)
- docker-compose.prod.yml (production)
Execute the following command:
docker compose -f docker-compose.dev.yml up -d
Create the database for the products service, using pgAdmin 4:
- Access pgAdmin: http://localhost:5050
- Login: admin@admin.com
- Password: root
- Create a database named "products"
- Run the query for the products service: sql/01_init.up.sql within the "products" database to create the tables for this service. Restart the products-srv service in Docker.
In the infra project folder, navigate to the k8s folder. In this folder, you'll find the following files:
-
deploy.sh (deploy the application)
- run the deploy.sh executable.
-
destroy.sh (bring down the application)
- run the destroy.sh executable.
To access the application: https://localhost or https://mymicroservices.com
Infrastructure deployment was developed by oceano.dev team under the MIT license.