-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
160 lines (148 loc) · 4.03 KB
/
docker-compose.yaml
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
services:
kafka:
image: 'bitnami/kafka:latest'
restart: always
ports:
- '9094:9094'
environment:
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://:9092,CONTROLLER://:9093,EXTERNAL://:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
- ALLOW_PLAINTEXT_LISTENER=yes
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=PLAINTEXT
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094
- KAFKA_CFG_CLUSTER_ID=SnakBk5ASCy57YnMCL48hg
networks:
- app-tier
- campride_network
volumes:
- 'kafka_data:/bitnami/kafka/data'
kafka-ui:
image: provectuslabs/kafka-ui:latest
restart: always
container_name: kafka-ui
ports:
- '10005:8081'
environment:
- SERVER_PORT=8081
- KAFKA_CLUSTERS_0_NAME=campride-kafka
- KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS=kafka:9092
- DYNAMIC_CONFIG_ENABLED=true
- KAFKA_CLUSTERS_0_AUDIT_TOPICAUDITENABLED=true
- KAFKA_CLUSTERS_0_AUDIT_CONSOLEAUDITENABLED=true
networks:
- app-tier
- campride_network
db:
container_name: campride_db
image: mysql
environment:
MYSQL_DATABASE: ${MYSQL_NAME}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
ports:
- "3307:3306"
volumes:
- db-data:/var/lib/mysql
restart: always
networks:
- campride_network
- app-tier
command: [ 'mysqld', '--character-set-server=utf8mb4', '--collation-server=utf8mb4_unicode_ci' ]
redis:
container_name: campride_redis
image: redis:latest
ports:
- "6379:6379"
restart: always
volumes:
- ./redis_data:/data
networks:
- campride_network
- app-tier
command: redis-server --maxmemory 2gb --maxmemory-policy allkeys-lru
redis-insight:
image: redislabs/redisinsight:latest
container_name: redis_insight
restart: always
ports:
- "5540:5540"
networks:
- campride_network
app-blue:
container_name: campride-api-server-blue
build: .
volumes:
- ./logs:/logs
- ./build/libs:/app/libs
ports:
- "8080:8080"
environment:
SPRING_DATASOURCE_URL: ${MYSQL_PROD_URL}
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
SERVER_PORT: 8080
depends_on:
- db
restart: always
networks:
- campride_network
- app-tier
app-green:
container_name: campride-api-server-green
build: .
volumes:
- ./logs:/logs
- ./build/libs:/app/libs
ports:
- "8081:8081"
environment:
SPRING_DATASOURCE_URL: ${MYSQL_PROD_URL}
SPRING_DATASOURCE_USERNAME: ${MYSQL_USER}
SPRING_DATASOURCE_PASSWORD: ${MYSQL_PASSWORD}
SERVER_PORT: 8081
depends_on:
- db
restart: always
networks:
- campride_network
- app-tier
nginx:
image: nginx:latest
restart: unless-stopped
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./data/nginx:/etc/nginx/conf.d
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
depends_on:
- app-blue
- app-green
networks:
- campride_network
- app-tier
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
certbot:
restart: unless-stopped
image: certbot/certbot
container_name: certbot
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
redis_data:
db-data:
kafka_data:
driver: local
networks:
campride_network:
app-tier:
driver: bridge