-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
144 lines (135 loc) · 3.43 KB
/
docker-compose.yml
File metadata and controls
144 lines (135 loc) · 3.43 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
services:
# PostgreSQL Database
postgres:
image: postgres:15-alpine
restart: always
environment:
POSTGRES_USER: ${POSTGRES_USER:-cloudquery}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-secure_password}
POSTGRES_DB: ${POSTGRES_DB:-cloudquery_security}
volumes:
- postgres_data:/var/lib/postgresql/data
- ./backend/migrations:/docker-entrypoint-initdb.d
ports:
- "5433:5432"
networks:
- app_network
# Redis for Caching
redis:
image: redis:7-alpine
restart: always
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- app_network
# FastAPI Backend
backend:
build:
context: ./backend
dockerfile: Dockerfile
restart: always
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-cloudquery}:${POSTGRES_PASSWORD:-secure_password}@postgres:5432/${POSTGRES_DB:-cloudquery_security}
REDIS_URL: redis://redis:6379
CORS_ORIGINS: '["*"]'
env_file:
- .env
ports:
- "8000:8000"
depends_on:
- postgres
- redis
volumes:
- ./data:/app/data
- ./cloudquery/configs:/app/cloudquery
networks:
- app_network
# Next.js Frontend
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
restart: always
environment:
NEXT_PUBLIC_API_URL: http://backend:8000
ports:
- "3000:3000"
depends_on:
- backend
networks:
- app_network
# CloudQuery Sync Service
cloudquery:
image: ghcr.io/cloudquery/cloudquery:latest
restart: "no"
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-cloudquery}:${POSTGRES_PASSWORD:-secure_password}@postgres:5432/${POSTGRES_DB:-cloudquery_security}
# Don't set GOOGLE_APPLICATION_CREDENTIALS to use application default credentials
env_file:
- .env
volumes:
- ./cloudquery/configs:/configs
- ./data:/data
# Mount gcloud application default credentials
- ~/.config/gcloud:/root/.config/gcloud:ro
depends_on:
- postgres
networks:
- app_network
profiles:
- sync # Only start when explicitly requested
# Prometheus for Monitoring
prometheus:
image: prom/prometheus:v2.45.0
restart: always
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
networks:
- app_network
# Data Processor Worker
data-processor:
build:
context: ./backend
dockerfile: Dockerfile
restart: always
environment:
DATABASE_URL: postgresql://${POSTGRES_USER:-cloudquery}:${POSTGRES_PASSWORD:-secure_password}@postgres:5432/${POSTGRES_DB:-cloudquery_security}
REDIS_URL: redis://redis:6379
env_file:
- .env
command: python app/workers/simple_data_processor.py
depends_on:
- postgres
- redis
volumes:
- ./data:/app/data
networks:
- app_network
# Grafana for Visualization
grafana:
image: grafana/grafana:latest
restart: always
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD:-admin}
ports:
- "3001:3000"
volumes:
- grafana_data:/var/lib/grafana
- ./monitoring/grafana:/etc/grafana/provisioning
depends_on:
- prometheus
networks:
- app_network
volumes:
postgres_data:
redis_data:
prometheus_data:
grafana_data:
networks:
app_network:
driver: bridge