-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
136 lines (135 loc) · 3.42 KB
/
docker-compose.yml
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
services:
proxy-service:
container_name: proxy-service
image: nginx:${NGINX_VERSION}
ports:
- "80:80"
- "443:443"
volumes:
- './nginx/nginx.conf:/etc/nginx/nginx.conf:ro'
- './nginx/nginx.conf.default:/etc/nginx/conf.d/default.conf:ro'
- './nginx/ssl:/etc/nginx/ssl:ro'
networks:
- blog-network
depends_on:
- frontend-service
frontend-service:
image: frontend-service:${FRONTEND_SERVICE_VERSION}
ports:
- "5173:5173"
environment:
PORT: 5173
API_TOKEN: 123456
COMMENT_SERVICE_URI: http://comment-service:2001
BLOG_SERVICE_URI: http://blog-service:2000
AUTH_SERVICE_URI: http://auth-service:2002
depends_on:
- comment-service
- blog-service
networks:
- blog-network
build:
context: ./frontend
blog-service:
container_name: blog-service
image: blog-service:${BLOG_SERVICE_VERSION}
ports:
- "2000:2000"
environment:
PORT: 2000
API_TOKEN: 123456
MONGO_URI: mongodb://root:secret@mongo-service:27017/blog?authSource=admin
depends_on:
- mongo-service
networks:
- blog-network
build:
context: ./blog
comment-service:
container_name: comment-service
image: comment-service:${COMMENT_SERVICE_VERSION}
ports:
- "2001:2001"
environment:
PORT: 2001
API_TOKEN: 123456
MONGO_URI: mongodb://root:secret@mongo-service:27017/comment?authSource=admin
depends_on:
- mongo-service
networks:
- blog-network
build:
context: ./comment
auth-service:
container_name: auth-service
image: auth-service:${AUTH_SERVICE_VERSION}
ports:
- "2002:2002"
environment:
PORT: 2002
API_TOKEN: 123456
MONGO_URI: mongodb://root:secret@mongo-service:27017/comment?authSource=admin
depends_on:
- mongo-service
networks:
- blog-network
build:
context: ./auth
mongo-service:
container_name: mongo-service
image: mongo:${MONGO_VERSION}
ports:
- "27017:27017"
volumes:
- ./mongo:/data/db
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
networks:
- blog-network
prometheus-service:
image: prom/prometheus:${PROMETHEUS_VERSION}
ports:
- "9090:9090"
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
networks:
- blog-network
prometheus-mongodb-exporter:
image: percona/mongodb_exporter:${MONGODB_EXPORTER_VERSION}
ports:
- "9216:9216"
environment:
MONGODB_URI: "mongodb://root:secret@mongo-service:27017"
networks:
- blog-network
depends_on:
- mongo-service
- prometheus-service
prometheus-nginx-exporter:
image: nginx/nginx-prometheus-exporter:${NGINX_EXPORTER_VERSION}
ports:
- "9113:9113"
depends_on:
- proxy-service
- prometheus-service
environment:
SCRAPE_URI: http://proxy-service:80/stub_status
networks:
- blog-network
grafana-service:
image: grafana/grafana:${GRAFANA_VERSION}
ports:
- "3000:3000"
environment:
- GF_SECURITY_ADMIN_PASSWORD=secret
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
- ./grafana/dashboards:/var/lib/grafana/dashboards
networks:
- blog-network
depends_on:
- prometheus-service
networks:
blog-network:
driver: bridge