forked from gardener/inventory
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
162 lines (152 loc) · 4.33 KB
/
docker-compose.yaml
File metadata and controls
162 lines (152 loc) · 4.33 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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
---
x-postgres:
uri: &postgres-uri 'postgresql://inventory:p4ssw0rd@postgres:5432/inventory?sslmode=disable'
user: &postgres-user inventory
password: &postgres-password 'p4ssw0rd'
db_name: &postgres-db-name inventory
port: &postgres-port 5432
x-redis:
endpoint: &redis-endpoint 'valkey:6379'
services:
postgres:
ports:
- 5432:5432
image: postgres:17.4
environment:
POSTGRES_USER: *postgres-user
POSTGRES_PASSWORD: *postgres-password
POSTGRES_DB: *postgres-db-name
volumes:
- ./dev/local/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "--username", *postgres-user]
interval: 5s
timeout: 5s
retries: 5
valkey:
ports:
- 6379:6379
image: valkey/valkey:8.1-alpine
volumes:
- ./dev/local/valkey:/data
healthcheck:
test: ["CMD", "valkey-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
vault:
image: hashicorp/vault:1.20
ports:
- 8200:8200
healthcheck:
test: curl --fail -I http://localhost:8200/ui/sys/health || exit 1
interval: 15s
timeout: 5s
retries: 5
volumes:
- ./dev/local/vault:/vault/file
worker:
build:
context: .
dockerfile: Dockerfile
ports:
- 6080:6080
entrypoint: ["/app/inventory", "worker", "start"]
hostname: inventory-worker-1
healthcheck:
test: ["CMD", "/app/inventory", "worker", "ping", "--name", "inventory-worker-1"]
interval: 5s
timeout: 5s
retries: 5
environment:
KUBECONFIG: /home/nonroot/.kube/config
KUBECACHEDIR: /home/nonroot/.kube/cache
AWS_CONFIG_FILE: /home/nonroot/.aws/config
AWS_SHARED_CREDENTIALS_FILE: /home/nonroot/.aws/credentials
AWS_PROFILE: default
CLOUDSDK_CONFIG: /home/nonroot/.config/gcloud
INVENTORY_CONFIG: /home/nonroot/config.yaml
REDIS_ENDPOINT: *redis-endpoint
DATABASE_URI: *postgres-uri
depends_on:
valkey:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
- ~/.aws:/home/nonroot/.aws
- ~/.kube/cache:/home/nonroot/.kube/cache
- ${KUBECONFIG}:/home/nonroot/.kube/config
- ./examples/config.yaml:/home/nonroot/config.yaml
- ~/.config/gcloud:/home/nonroot/.config/gcloud
scheduler:
build:
context: .
dockerfile: Dockerfile
entrypoint: ["/app/inventory", "scheduler", "start"]
environment:
INVENTORY_CONFIG: /home/nonroot/config.yaml
REDIS_ENDPOINT: *redis-endpoint
depends_on:
valkey:
condition: service_healthy
volumes:
- ./examples/config.yaml:/home/nonroot/config.yaml
dashboard:
ports:
- 8080:8080
build:
context: .
dockerfile: Dockerfile
entrypoint: ["/app/inventory", "dashboard", "start"]
environment:
INVENTORY_CONFIG: /home/nonroot/config.yaml
REDIS_ENDPOINT: *redis-endpoint
PROMETHEUS_ENDPOINT: http://prometheus:9090/
depends_on:
valkey:
condition: service_healthy
volumes:
- ./examples/config.yaml:/home/nonroot/config.yaml
grafana:
image: grafana/grafana:11.0.0-ubuntu
ports:
- 3000:3000
healthcheck:
test: curl --fail -I http://localhost:3000/api/health || exit 1
interval: 15s
timeout: 5s
retries: 5
depends_on:
postgres:
condition: service_healthy
volumes:
- ./extra/grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./extra/grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
- ./extra/grafana/dashboards:/var/lib/grafana/dashboards
prometheus:
image: prom/prometheus:v3.3.1
entrypoint:
- /bin/prometheus
- "--config.file=/etc/prometheus/prometheus.yml"
- "--storage.tsdb.path=/prometheus"
- --web.enable-admin-api
ports:
- 9090:9090
depends_on:
dashboard:
condition: service_started
volumes:
- ./extra/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./dev/local/prometheus:/prometheus
pgadmin:
image: dpage/pgadmin4:9.3.0
ports:
- 7080:80
environment:
PGADMIN_DEFAULT_PASSWORD: p4ssw0rd
PGADMIN_DEFAULT_EMAIL: inventory@foo.bar
PGADMIN_DISABLE_POSTFIX: true
depends_on:
postgres:
condition: service_healthy