-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (105 loc) · 2.56 KB
/
docker-compose.yml
File metadata and controls
114 lines (105 loc) · 2.56 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
version: "3.9"
services:
app:
build:
context: ./app
dockerfile: Dockerfile
container_name: devops_app
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://devops:devops@postgres:5432/devopsdb
REDIS_URL: redis://redis:6379/0
CACHE_TTL_SECONDS: "60"
SECRET_KEY: "change-me-in-production-use-a-long-random-string"
ACCESS_TOKEN_EXPIRE_MINUTES: "30"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://jaeger:4317"
SERVICE_NAME: "devops-platform"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- devops_net
healthcheck:
test: ["CMD", "python", "-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
postgres:
image: postgres:16-alpine
container_name: devops_postgres
environment:
POSTGRES_USER: devops
POSTGRES_PASSWORD: devops
POSTGRES_DB: devopsdb
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U devops -d devopsdb"]
interval: 10s
timeout: 5s
retries: 5
networks:
- devops_net
redis:
image: redis:7-alpine
container_name: devops_redis
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --save 60 1 --loglevel warning
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- devops_net
jaeger:
image: jaegertracing/all-in-one:1.58
container_name: devops_jaeger
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC
environment:
COLLECTOR_OTLP_ENABLED: "true"
networks:
- devops_net
prometheus:
image: prom/prometheus:v2.52.0
container_name: devops_prometheus
ports:
- "9090:9090"
volumes:
- ./monitoring/prometheus.yml:/etc/prometheus/prometheus.yml:ro
networks:
- devops_net
grafana:
image: grafana/grafana:10.4.2
container_name: devops_grafana
ports:
- "3000:3000"
environment:
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
networks:
- devops_net
volumes:
postgres_data:
redis_data:
grafana_data:
networks:
devops_net:
driver: bridge