-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
145 lines (134 loc) · 3.79 KB
/
docker-compose.yml
File metadata and controls
145 lines (134 loc) · 3.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# StormDB v2 Docker Compose - Development and Testing Environment
version: '3.8'
services:
# PostgreSQL database for testing
postgres:
image: postgres:15-alpine
container_name: stormdb-postgres
environment:
POSTGRES_DB: tpcc_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_INITDB_ARGS: "--encoding=UTF8 --locale=C"
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-scripts:/docker-entrypoint-initdb.d
networks:
- stormdb-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
command: >
postgres
-c shared_preload_libraries=pg_stat_statements
-c pg_stat_statements.track=all
-c max_connections=1000
-c shared_buffers=256MB
-c effective_cache_size=1GB
-c work_mem=4MB
-c maintenance_work_mem=64MB
# StormDB v2 application
stormdb:
build:
context: .
dockerfile: Dockerfile
container_name: stormdb-v2
ports:
- "8080:8080"
environment:
# Database connection
STORMDB_DATABASE_HOST: postgres
STORMDB_DATABASE_PORT: 5432
STORMDB_DATABASE_NAME: tpcc_test
STORMDB_DATABASE_USER: postgres
STORMDB_DATABASE_PASSWORD: postgres
STORMDB_DATABASE_SSL_MODE: disable
STORMDB_DATABASE_MAX_CONNECTIONS: 50
# API configuration
STORMDB_API_HOST: 0.0.0.0
STORMDB_API_PORT: 8080
# Logging
STORMDB_LOGGING_LEVEL: info
STORMDB_LOGGING_FORMAT: json
STORMDB_LOGGING_OUTPUT: stdout
# Scheduler
STORMDB_SCHEDULER_ENABLED: true
STORMDB_SCHEDULER_WORKER_POOL_SIZE: 10
# Plugin directory
STORMDB_PLUGIN_DIR: /var/lib/stormdb/plugins
volumes:
- stormdb_data:/app/data
- stormdb_logs:/app/logs
- ./config:/app/config
networks:
- stormdb-network
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
restart: unless-stopped
# Grafana for monitoring (optional)
grafana:
image: grafana/grafana:latest
container_name: stormdb-grafana
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
GF_INSTALL_PLUGINS: grafana-piechart-panel,grafana-worldmap-panel
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana:/etc/grafana/provisioning
networks:
- stormdb-network
restart: unless-stopped
profiles:
- monitoring
# Prometheus for metrics collection (optional)
prometheus:
image: prom/prometheus:latest
container_name: stormdb-prometheus
ports:
- "9090:9090"
volumes:
- prometheus_data:/prometheus
- ./monitoring/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
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=200h'
- '--web.enable-lifecycle'
networks:
- stormdb-network
restart: unless-stopped
profiles:
- monitoring
volumes:
postgres_data:
driver: local
stormdb_data:
driver: local
stormdb_logs:
driver: local
grafana_data:
driver: local
prometheus_data:
driver: local
networks:
stormdb-network:
driver: bridge
# Environment profiles:
# Default: docker-compose up (stormdb + postgres)
# With monitoring: docker-compose --profile monitoring up
# Development: docker-compose -f docker-compose.yml -f docker-compose.dev.yml up