-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
114 lines (107 loc) · 2.52 KB
/
docker-compose.yml
File metadata and controls
114 lines (107 loc) · 2.52 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
version: "3.8"
services:
redis:
image: redis:7-alpine
container_name: windfall-redis
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
expose:
- "6379"
networks:
- windfall-net
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 10
mysql:
image: mysql:8.0
container_name: windfall-mysql
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_unicode_ci
volumes:
- mysql-data:/var/lib/mysql
env_file:
- .env
expose:
- "3306"
networks:
- windfall-net
restart: unless-stopped
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 10s
timeout: 5s
retries: 15
wind-fall-blue:
image: ${DOCKER_USERNAME}/windfall:${APP_IMAGE_TAG:-latest}
container_name: wind-fall-blue
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
environment:
SPRING_PROFILES_ACTIVE: blue
SERVER_PORT: 8080
REDIS_HOST: redis
expose:
- "8080"
networks:
- windfall-net
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/actuator/health"]
interval: 10s
timeout: 3s
retries: 20
start_period: 60s
wind-fall-green:
image: ${DOCKER_USERNAME}/windfall:${APP_IMAGE_TAG:-latest}
container_name: wind-fall-green
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
environment:
SPRING_PROFILES_ACTIVE: green
SERVER_PORT: 8080
REDIS_HOST: redis
expose:
- "8080"
networks:
- windfall-net
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/actuator/health"]
interval: 10s
timeout: 3s
retries: 20
start_period: 60s
nginx:
image: nginx:alpine
container_name: windfall-nginx
ports:
- "${NGINX_HTTP_PORT:-80}:80"
- "${NGINX_HTTPS_PORT:-443}:443"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
- ./certs:/etc/nginx/certs:ro
- /etc/letsencrypt:/etc/letsencrypt:ro
networks:
- windfall-net
restart: unless-stopped
networks:
windfall-net:
driver: bridge
volumes:
mysql-data:
redis-data: