-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.dev.yml
134 lines (134 loc) · 3.39 KB
/
docker-compose.dev.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
version: "3.9"
services:
# RabbitMQ Message Broker
rabbitmq:
profiles:
- rabbitmq
image: rabbitmq:3-management
ports:
- "15672:15672"
- "5672:5672"
volumes:
- ~/.docker-conf/rabbitmq/data/:/var/lib/rabbitmq/
- ~/.docker-conf/rabbitmq/log/:/var/log/rabbitmq
environment:
RABBITMQ_DEFAULT_USER: "user"
RABBITMQ_DEFAULT_PASS: "password"
restart: always
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 30s
timeout: 30s
retries: 3
redis:
image: redis
# Core Service
core-service:
build:
context: ./service/core
ports:
- "8080:8080"
restart: on-failure
depends_on:
# rabbitmq:
# condition: service_healthy
redis:
condition: service_started
auth-service:
condition: service_started
storage-service:
condition: service_started
prometheus:
condition: service_started
links:
# - rabbitmq
- redis
- auth-service
- storage-service
environment:
- RABBITMQ_URL=amqp://user:password@rabbitmq:5672
- REDIS_HOST=redis
- REDIS_PORT=6379
- AUTH_SERVICE_HOST=auth-service
- AUTH_SERVICE_PORT=50051
- STORAGE_SERVICE_HOST=storage-service
- STORAGE_SERVICE_PORT=50052
- AWS_ACCESS_KEY_ID=${ACCESS_KEY}
- AWS_SECRET_ACCESS_KEY=${SECRET_ACCESS_KEY}
- SMTP_CLIENT_ID=${SMTP_CLIENT_ID}
- SMTP_CLIENT_SECRET=${SMTP_CLIENT_SECRET}
- SMTP_ACCESS_TOKEN=${SMTP_ACCESS_TOKEN}
- SMTP_REFRESH_TOKEN=${SMTP_REFRESH_TOKEN}
- DYNAMODB_ROLE_EXTERNAL_ID=${DYNAMODB_ROLE_EXTERNAL_ID}
volumes:
- ./service/core/config.json:/config.json
# Auth Service
auth-service:
hostname: auth-service
build:
context: ./service/auth
ports:
- "8081:8081"
- "50051:50051"
restart: on-failure
volumes:
- ./service/auth/config.json:/config.json
# Storage Service
storage-service:
hostname: storage-service
build:
context: ./service/storage
ports:
- "50052:50052"
restart: on-failure
volumes:
- ./service/storage/data:/data
- ./service/storage/config.json:/config.json
environment:
- AWS_ACCESS_KEY_ID=${ACCESS_KEY}
- AWS_SECRET_ACCESS_KEY=${SECRET_ACCESS_KEY}
# Web
web:
build:
context: ./web
ports:
- "3000:3000"
environment:
- REACT_APP_API_URL=/api
# Prometheus
prometheus:
image: prom/prometheus:v2.27.0
volumes:
- ./config/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- 9090:9090
restart: unless-stopped
# Grafana
grafana:
image: grafana/grafana:7.5.6
ports:
- 3001:3000
volumes:
- grafana-storage:/var/lib/grafana
restart: unless-stopped
# Telegraf
# Telegraf will collect the metrics about the server resources (memory, CPU, disk, and network traffic)
# and Docker daemon (usage of resources per container), and then forward these metrics to the Prometheus server
telegraf:
image: telegraf:latest
volumes:
- ./config/telegraf.conf:/etc/telegraf/telegraf.conf
- /var/run/docker.sock:/var/run/docker.sock
# NGINX
nginx:
image: nginx
ports:
- 80:80
volumes:
- ./router/nginx.conf:/etc/nginx/nginx.conf
depends_on:
- core-service
- web
restart: always
volumes:
grafana-storage: