This guide provides instructions on how to set up and run the Laravel microservices project using Docker.
Ensure you have the following installed:
- PHP 8.2 or Up
- Laravel 12
- Redis
- MySQL 8.4
- VueJs 3
- Pinia 3.0
- Vue-Router 4.5
- Bootstrap 5
- Node v22.14.0
- NPM 10.9.2
git clone https://github.com/aixen/docker-setup.git
cd laravel-microservices
Edit your hosts file to map domains to localhost:
sudo nano /etc/hosts # For macOS/Linux
notepad C:\Windows\System32\drivers\etc\hosts # For Windows
Add the following line:
127.0.0.1 gateway.local
127.0.0.1 auth.local
Save and close the file.
Run the following command to start the services:
docker-compose up -d --build
This will build and start the following services this is all dynamic containers name:
- nginx (Nginx Reverse Proxy)
- php_workspace (PHP Environment)
- mysql (MySQL Database)
- redis (Redis for caching)
- app-gateway (Laravel Gateway Microservice)
- app-authentication (Laravel Authentication Microservice)
- Laravel Gateway Microservice: http://gateway.local
- Laravel Authentication Microservice: http://auth.local
- MySQL Database: Use
mysql_db
, usernameroot
, passwordroot
(via MySQL Workbench)
To stop all running containers:
docker-compose down
- View running containers:
docker ps -a
- Rebuild container:
docker-compose up -d --build
- Enter a container workspace per service:
docker exec -it gateway-workspace bash docker exec -it authentication-workspace bash