# Docker Compose s pokročilými health check nastaveními
version: '3.8'
services:
mcp-server:
build:
context: .
dockerfile: apps/mcp-server/Dockerfile
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- PORT=3001
restart: unless-stopped
# Základní health check
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3001/health/live"]
interval: 30s
timeout: 5s
start_period: 30s
retries: 3
# Závislosti na dalších službách
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
# Redis pro session management
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3
# PostgreSQL databáze
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: mcpserver
POSTGRES_USER: mcpuser
POSTGRES_PASSWORD: mcppassword
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U mcpuser -d mcpserver"]
interval: 30s
timeout: 10s
start_period: 30s
retries: 3
# Nginx jako reverse proxy
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- mcp-server
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"]
interval: 30s
timeout: 3s
start_period: 5s
retries: 3
volumes:
postgres_data: