A comprehensive Docker-based development environment that provides a full-stack application with monitoring, CI/CD, and AI capabilities for training and development purposes.
The project consists of multiple interconnected services that simulate a production-like environment:
flowchart LR
F[Frontend<br/>React App<br/>Port 8081]
B[Backend<br/>Spring Boot<br/>Port 4001]
MQ[ActiveMQ<br/>Message Broker<br/>Port 61616/8161]
C[Consumer<br/>JMS Email<br/>Port 4002]
E[Mailhog<br/>Email Server<br/>Port 8025]
DB[(PostgreSQL<br/>Database<br/>Port 5432)]
PM[Prometheus<br/>Metrics<br/>Port 9090]
IDB[InfluxDB<br/>Time Series<br/>Port 8086]
GF[Grafana<br/>Dashboards<br/>Port 3000]
O[Ollama<br/>LLM Server<br/>Port 11434]
CDN[Nginx Static<br/>CDN<br/>Port 8082]
F -- REST API --> B
B -- JMS Messages --> MQ
MQ -- JMS Messages --> C
C -- SMTP --> E
B -- Database --> DB
B -- LLM API --> O
F -- Static Assets --> CDN
PM -- Scrapes Metrics --> B
PM -- Scrapes Metrics --> C
GF -- Queries Metrics --> PM
GF -- Queries Data --> IDB
This environment demonstrates a microservices architecture where each service is developed as a separate codebase:
- Backend API - Handles business logic, authentication, and data persistence
- Frontend App - Provides user interface and client-side functionality
- Email Consumer - Processes asynchronous email notifications
- User interactions β Frontend React app
- API requests β Backend Spring Boot service
- Async notifications β ActiveMQ β Email Consumer β Mailhog
- Static assets β Nginx CDN for optimized delivery
- Independent development - Each team can work on their service
- Technology diversity - Different tech stacks per service
- Scalability - Services can be scaled independently
- Fault isolation - Issues in one service don't affect others
docker compose up -d
Using Docker Compose directly:
./run-docker-compose.sh
Using individual Docker commands:
./docker-run-all.sh
CI Environment (No Monitoring/Jenkins):
docker compose -f docker-compose-ci.yml up -d
Minimal Environment (Backend + Frontend only):
docker compose -f lightweight-docker-compose.yml up -d
# Stop and remove containers with volumes
docker compose down --volumes
# Complete cleanup (all Docker resources)
./docker-prune.sh
Service | URL | Description | Credentials |
---|---|---|---|
Backend API | http://localhost:4001/swagger-ui/index.html | Spring Boot REST API with Swagger docs (source) | - |
Frontend | http://localhost:8081/login | React application (source) | - |
Prometheus | http://localhost:9090/ | Metrics collection and monitoring | - |
Grafana | http://localhost:3000/login | Dashboards and visualization | admin/grafana |
ActiveMQ | http://localhost:8161 | Message broker web console | admin/admin |
Mailhog | http://localhost:8025/ | Email testing interface | - |
Nginx CDN | http://localhost:8082/images/ | Static asset delivery | - |
Email Consumer | http://localhost:4002/actuator/prometheus | JMS email processing service (source) | - |
Ollama LLM | http://localhost:11434/api/tags | Local AI model server | - |
- Host: localhost
- Port: 5432
- Database: testdb
- Username: postgres
- Password: postgres
Using Docker:
# Connect to database
docker exec -it postgres psql -U postgres -d testdb
# Common commands:
\dt # List tables
\d table_name # Describe table structure
\q # Quit psql
Using external tools:
- Use any PostgreSQL client with the credentials above
- Popular options: pgAdmin, DBeaver, DataGrip
The application uses the following main tables:
app_user
- User managementproducts
- Product catalogcart_items
- Shopping cartorders
- Order management
The Nginx server acts as a CDN for static assets:
- Port: 8082
- Local Directory:
./images/
- Container Path:
/usr/share/nginx/html/images
- Access:
http://localhost:8082/images/filename.jpg
Available Assets:
- Product images (applewatch.png, cleancode.png, iphone.png, etc.)
- Brand logos (samsung.png, sony.png, mac.png, etc.)
- Configuration:
./prometheus/prometheus.yml
- Scrape Interval: 5s for Spring Boot apps, 10s global
- Targets: Backend (4001), Consumer (4002)
- Pre-configured Dashboards:
- Spring Boot Application Metrics
- HTTP Request Monitoring
- K6 Load Testing Results
- Data Sources: Prometheus, InfluxDB
- Login: admin/grafana
- Database: db0
- Credentials: admin/admin
- Purpose: Time-series data storage for load testing
- Model: qwen3-thinking (pre-loaded)
- API Endpoint: http://localhost:11434
- Custom Image: slawekradzyminski/ollama:qwen3-thinking
Testing the LLM:
curl -X POST http://localhost:11434/api/generate -d '{
"model": "qwen3:0.6b",
"prompt": "What is Docker?"
}'
- JMS Port: 61616
- Web Console: 8161
- AMQP Port: 5672
- Credentials: admin/admin
- Features: Anonymous login enabled, security disabled for development
- Service: slawekradzyminski/consumer:1.3
- Purpose: Processes JMS messages and sends emails via SMTP
- Monitoring: Exposes Prometheus metrics
- Custom Image: Built from local Dockerfile
- Plugins: Blue Ocean, Docker Workflow, Docker Plugin
- Docker Integration: Full Docker-in-Docker support
- Ports: 8080 (web), 50000 (agents)
Starting Jenkins separately:
docker compose -f docker-compose-jenkins.yml up -d
- Web Interface: http://localhost:8025
- SMTP Port: 1025
- Purpose: Catches all emails for testing without sending to real addresses
# Run load tests with InfluxDB output
K6_INFLUXDB_PUSH_INTERVAL=2s k6 run --out influxdb=http://localhost:8086/db0 dist/user-journey.js
# Access container shell
docker exec -it <container_name> bash
# View logs
docker logs <container_name>
# Stop specific service
docker compose stop <service_name>
- Network Name: my-private-ntwk
- Type: Bridge network
- Purpose: Isolated communication between services
This development environment orchestrates services from multiple dedicated repositories:
- Backend API - Spring Boot REST API with JWT authentication, user management, and e-commerce features
- Frontend App - React + TypeScript application with modern UI, authentication, and admin dashboard
- Email Consumer - JMS message processor that handles email notifications via ActiveMQ
Each component is designed to work seamlessly together:
- Backend exposes REST APIs consumed by the Frontend
- Backend publishes JMS messages to ActiveMQ
- Email Consumer processes messages and sends emails via Mailhog
- Frontend serves static assets through Nginx CDN
- Clone individual repositories for focused development
- Use this orchestration project for full-stack testing
- Each service can be developed independently with Docker containers
- All services including monitoring, CI/CD, and AI
- Persistent volumes for data storage
- Complete development environment
- Core application services only
- No monitoring or Jenkins
- Suitable for CI/CD pipelines
- Backend and Frontend only
- Minimal resource usage
- Quick development setup
- Standalone Jenkins with Docker support
- Custom image with pre-installed plugins
- Ollama server with persistent model storage
- Independent AI development environment
- Port conflicts: Ensure ports are not used by other services
- Container startup order: Services have proper dependencies configured
- Volume permissions: Docker volumes are created automatically
- Network connectivity: All services use the same bridge network
# View all container logs
docker compose logs
# View specific service logs
docker compose logs backend
# Follow logs in real-time
docker compose logs -f
This project is designed for training and development purposes. All external services and images maintain their respective licenses.