fixing docker-compose

This commit is contained in:
stefan
2025-09-11 15:25:56 +02:00
parent 11e049b0f6
commit 3ed5a9cece
2 changed files with 173 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
# Docker Compose Fix Summary - Meldestelle Project
## Issues Identified and Fixed
### Problem Description
The user reported that `docker-compose.services.yml` and `docker-compose.clients.yml` were not working properly, while `docker-compose.yml` worked except for a Keycloak issue.
### Root Causes Identified
1. **Standalone Execution Issue**: The services and clients compose files were designed to work in combination with the main infrastructure file, not as standalone files
2. **Keycloak Port Mismatch**: Auth-server in clients.yml was trying to connect to `keycloak:8081` but Keycloak runs on port `8080`
3. **Network Configuration Error**: clients.yml had `external: false` instead of `external: true` for the shared network
### Fixes Applied
#### 1. Fixed Keycloak Port Reference
**File**: `docker-compose.clients.yml`
**Line**: 102
**Change**:
```
BEFORE: KEYCLOAK_SERVER_URL: http://keycloak:8081
AFTER: KEYCLOAK_SERVER_URL: http://keycloak:8080
```
#### 2. Fixed Network Configuration
**File**: `docker-compose.clients.yml`
**Line**: 177
**Change**:
```
BEFORE: external: false
AFTER: external: true
```
## Correct Usage Instructions
### 1. Infrastructure Only (Base Services)
```bash
docker compose -f docker-compose.yml up -d
```
This starts: PostgreSQL, Redis, Keycloak, Consul, Kafka, Prometheus, Grafana, API Gateway
### 2. Infrastructure + Application Services
```bash
docker compose -f docker-compose.yml -f docker-compose.services.yml up -d
```
This adds: Ping Service (and other services when uncommented)
### 3. Full Stack (Infrastructure + Services + Clients)
```bash
docker compose -f docker-compose.yml -f docker-compose.services.yml -f docker-compose.clients.yml up -d
```
This adds: Web App, Desktop App, Auth Server, Monitoring Server
### 4. Infrastructure + Clients Only (Frontend Development)
```bash
docker compose -f docker-compose.yml -f docker-compose.clients.yml up -d
```
This is useful for frontend development without backend services.
## Important Notes
1. **Do not run services.yml or clients.yml standalone** - they depend on infrastructure services from the main compose file
2. **Always start with docker-compose.yml first** - it creates the shared network and infrastructure services
3. **Use the newer `docker compose` command** instead of `docker-compose` if you encounter Python module errors
4. **Service Dependencies**:
- Services depend on: consul, postgres, redis (from main compose)
- Clients depend on: api-gateway, keycloak, postgres (from main compose)
## Test Results
All combinations now pass configuration validation:
-`docker-compose.yml` - Works standalone
-`docker-compose.yml` + `docker-compose.services.yml` - Works combined
-`docker-compose.yml` + `docker-compose.clients.yml` - Works combined
- ✅ All three files combined - Works as full stack
## Status: RESOLVED ✅
The docker-compose configuration issues have been fixed. All files can now be started successfully using the correct command combinations shown above.