162 lines
4.3 KiB
YAML
Executable File
162 lines
4.3 KiB
YAML
Executable File
version: '3.8'
|
|
|
|
services:
|
|
context-plugin:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: marketally-context-plugin
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:8080"
|
|
- "8081:8081"
|
|
environment:
|
|
- ASPNETCORE_ENVIRONMENT=Production
|
|
- CONTEXT_STORAGE_PATH=/app/data/.context
|
|
- CONTEXT_LOG_LEVEL=Information
|
|
- CONTEXT_ENABLE_METRICS=true
|
|
- CONTEXT_ENABLE_HEALTH_CHECKS=true
|
|
- CONTEXT_MAX_CONTEXT_SIZE=50000
|
|
- CONTEXT_RETENTION_DAYS=90
|
|
- CONTEXT_ENABLE_COMPRESSION=true
|
|
- CONTEXT_ENABLE_CACHING=true
|
|
- CONTEXT_CACHE_EXPIRATION_MINUTES=30
|
|
- CONTEXT_MAX_CONCURRENT_OPERATIONS=10
|
|
- CONTEXT_ENABLE_ENCRYPTION=true
|
|
- CONTEXT_ENABLE_SENSITIVE_DATA_DETECTION=true
|
|
volumes:
|
|
- context-data:/app/data
|
|
- context-logs:/app/logs
|
|
- ./config:/app/config:ro
|
|
networks:
|
|
- context-network
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8081/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 60s
|
|
labels:
|
|
- "com.marketally.service=context-plugin"
|
|
- "com.marketally.version=1.0.0"
|
|
- "com.marketally.environment=production"
|
|
|
|
# Redis for caching (optional)
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: marketally-context-redis
|
|
restart: unless-stopped
|
|
ports:
|
|
- "6379:6379"
|
|
volumes:
|
|
- redis-data:/data
|
|
networks:
|
|
- context-network
|
|
command: redis-server --appendonly yes --maxmemory 256mb --maxmemory-policy allkeys-lru
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
|
|
# Prometheus for metrics collection (optional)
|
|
prometheus:
|
|
image: prom/prometheus:latest
|
|
container_name: marketally-context-prometheus
|
|
restart: unless-stopped
|
|
ports:
|
|
- "9090:9090"
|
|
volumes:
|
|
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
|
- prometheus-data:/prometheus
|
|
networks:
|
|
- context-network
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
|
- '--web.console.templates=/etc/prometheus/consoles'
|
|
- '--storage.tsdb.retention.time=15d'
|
|
- '--web.enable-lifecycle'
|
|
|
|
# Grafana for metrics visualization (optional)
|
|
grafana:
|
|
image: grafana/grafana:latest
|
|
container_name: marketally-context-grafana
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- GF_SECURITY_ADMIN_PASSWORD=admin123
|
|
- GF_USERS_ALLOW_SIGN_UP=false
|
|
volumes:
|
|
- grafana-data:/var/lib/grafana
|
|
- ./monitoring/grafana/dashboards:/etc/grafana/provisioning/dashboards:ro
|
|
- ./monitoring/grafana/datasources:/etc/grafana/provisioning/datasources:ro
|
|
networks:
|
|
- context-network
|
|
depends_on:
|
|
- prometheus
|
|
|
|
# Jaeger for distributed tracing (optional)
|
|
jaeger:
|
|
image: jaegertracing/all-in-one:latest
|
|
container_name: marketally-context-jaeger
|
|
restart: unless-stopped
|
|
ports:
|
|
- "16686:16686"
|
|
- "14268:14268"
|
|
environment:
|
|
- COLLECTOR_OTLP_ENABLED=true
|
|
networks:
|
|
- context-network
|
|
|
|
# Log aggregation with Loki (optional)
|
|
loki:
|
|
image: grafana/loki:latest
|
|
container_name: marketally-context-loki
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3100:3100"
|
|
volumes:
|
|
- ./monitoring/loki.yml:/etc/loki/local-config.yaml:ro
|
|
- loki-data:/loki
|
|
networks:
|
|
- context-network
|
|
command: -config.file=/etc/loki/local-config.yaml
|
|
|
|
# Log shipping with Promtail (optional)
|
|
promtail:
|
|
image: grafana/promtail:latest
|
|
container_name: marketally-context-promtail
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./monitoring/promtail.yml:/etc/promtail/config.yml:ro
|
|
- context-logs:/var/log/context:ro
|
|
- /var/log:/var/log:ro
|
|
networks:
|
|
- context-network
|
|
command: -config.file=/etc/promtail/config.yml
|
|
depends_on:
|
|
- loki
|
|
|
|
volumes:
|
|
context-data:
|
|
driver: local
|
|
context-logs:
|
|
driver: local
|
|
redis-data:
|
|
driver: local
|
|
prometheus-data:
|
|
driver: local
|
|
grafana-data:
|
|
driver: local
|
|
loki-data:
|
|
driver: local
|
|
|
|
networks:
|
|
context-network:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.20.0.0/16 |