This guide explains how to run the entire Library Management System (LMS) microservices suite using Docker Compose.
- Docker Desktop installed and running.
-
Open a terminal in the root directory of the project (where this file is located).
-
Run the following command to build and start all services:
docker-compose up --build -d
-
Wait for a few minutes for all services to start and for the database to initialize.
| Service | Container Name | Port | Swagger UI |
|---|---|---|---|
| Catalog Service | catalog-api |
5001 | http://localhost:5001/swagger |
| Inventory Service | inventory-api |
5002 | http://localhost:5002/swagger |
| User Identity Service | useridentity-api |
5003 | http://localhost:5003/swagger |
| Borrowing Service | borrowingreturns-api |
5004 | http://localhost:5004/swagger |
| Frontend | lms-frontend |
3000 | http://localhost:3000 |
| PostgreSQL | lms-postgres |
5432 | - |
| Redis | lms-redis |
6379 | - |
To stop all services and remove containers:
docker-compose downTo stop services and remove volumes (WARNING: this deletes all database data):
docker-compose down -v- Database Connection Errors: If services fail to connect to the database on first run, it might be because the database is still initializing. Docker Compose is configured to wait for the database to be healthy, but if issues persist, try restarting the specific service:
docker-compose restart <service-name>
- Port Conflicts: Ensure ports 5001-5004, 5432, and 6379 are not in use by other applications.