๐ณ Microservices Docker Compose Quickstart¶
A clean, scalable multi-repo microservices architecture powered by Docker Compose.
This repository acts as the orchestrator (Quickstart) โ it does not build service images locally. All images are pulled from the private registry.
๐ฅ๏ธ This setup is intended for localhost development and testing. It spins up the full stack on your local machine so you can develop and test against a real environment without deploying to any server.
โก TL;DR¶
docker login registry.nexus.castis.io
git clone https://mashup.castis.io/playtelly/Quickstart.git
cd Quickstart
make dev
That's it. The full stack runs locally. No cloning of individual service repos required. Environment variables are pre-configured.
โ๏ธ Prerequisites¶
1. Install Required Tools¶
- Docker
- Docker Compose (v2+)
- Make
Verify they're installed:
2. Docker Must Be Running¶
3. Login to the Private Registry¶
You must authenticate before pulling images:
Enter your credentials when prompted. If you don't have credentials, contact your team admin.
โ You only need to do this once per machine (credentials are cached by Docker).
๐ฅ Setup¶
1. Clone the Quickstart Repository¶
3. Verify Ports Are Free¶
Make sure these ports are not already in use on your machine:
| Port | Service |
|---|---|
8080 |
API Gateway |
5432 |
Postgres (dev only) |
6379 |
Redis (dev only) |
๐ Running the Stack¶
Option A โ Full Stack (Recommended)¶
make dev # Run all services in the foreground (logs visible)
make dev-d # Run all services in the background (detached)
Option B โ Layered Startup (Manual Control)¶
If you want to bring services up in stages, you must start infrastructure first:
make up-infra # Step 1: Start Postgres, Redis (always required first)
make up-services # Step 2: Start business logic services
make up-access # Step 3: Start API Gateway and Auth
โ ๏ธ Always run
make up-infrabefore any other layer. Services depend on the database and cache being ready.
Stop¶
๐ ๏ธ All Makefile Commands¶
Full Stack¶
| Command | Description |
|---|---|
make dev |
Run all services (foreground) |
make dev-d |
Run all services (background) |
make down |
Stop all |
make down-v |
Stop + remove volumes |
Layered Control¶
| Command | Description |
|---|---|
make up-infra |
Start infrastructure only (Postgres, Redis) |
make up-services |
Start infrastructure + business services |
make up-access |
Start full system including API Gateway |
Utilities¶
| Command | Description |
|---|---|
make logs |
View logs for all services |
make ps |
Show container status |
make restart |
Restart all services |
make pull |
Pull latest images from registry |
๐ Repository Structure¶
Quickstart/
โโโ compose/
โ โโโ access/ # API Gateway, Auth Service
โ โโโ infrastructure/ # Postgres, Redis, networks
โ โโโ services/ # User, Order Services
โโโ .env # Pre-configured (not committed)
โโโ .gitignore
โโโ docker-compose.yml # Base configuration
โโโ Makefile # Command shortcuts
โโโ README.md
Compose Folder Responsibilities¶
| Folder | Purpose | Contains |
|---|---|---|
compose/access/ |
Public-facing layer | API Gateway, Auth Service |
compose/services/ |
Business logic | User, Order, and other services |
compose/infrastructure/ |
Stateful services | Postgres, Redis |
๐ง What Happens Internally¶
- Docker Compose loads
docker-compose.yml - Images are pulled from
registry.nexus.castis.io(not built locally) - Services start in order: infrastructure โ services โ access
๐ Networking¶
All services communicate over Docker's internal network โ no manual setup needed. Networks are defined in compose/infrastructure/networks-volumes.yml and created automatically.
Service-to-service DNS resolution:
๐ญ Image Lifecycle¶
Developer pushes code
โ
CI/CD builds & tags image
โ
Image pushed to registry.nexus.castis.io
โ
You run `make dev` โ Docker pulls image
To pull the latest images without restarting:
Then restart to apply:
๐ Startup Order¶
compose/infrastructure/ (Postgres, Redis)
โ
compose/services/ (User, Order, ...)
โ
compose/access/ (API Gateway, Auth)
๐ง Troubleshooting¶
Image pull fails¶
Re-authenticate:
Port already in use¶
Container keeps restarting¶
Check logs for the specific service:
Database connection errors on first start¶
Infrastructure (Postgres) may not be fully ready before services start. Use layered startup instead of make dev:
๐ง Key Takeaways¶
- Single repo โ only clone
Quickstart - No local builds โ images come from
registry.nexus.castis.io - Login required โ
docker login registry.nexus.castis.iobefore first run - No
.envsetup needed โ environment is pre-configured - No manual network setup โ Docker Compose handles it
make up-infrafirst if running layers manually โ everything else depends on it
๐ก Suggested Next Steps¶
make doctorโ auto-check registry login, port conflicts, and.envcompletenesssetup.shโ guided first-time setup script- Healthcheck + wait-for-db (avoid startup race conditions on fresh installs)