-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
100 lines (92 loc) · 2.18 KB
/
docker-compose.yml
File metadata and controls
100 lines (92 loc) · 2.18 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
x-api-common: &api-common
image: retoday-api:latest
env_file:
- .env
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
healthcheck:
test: [ "CMD", "curl", "-sf", "http://localhost:8080/actuator/health" ]
interval: 5s
timeout: 3s
retries: 20
start_period: 45s
services:
mysql:
image: mysql:8.0
container_name: retoday-db
environment:
- MYSQL_ROOT_PASSWORD=${MAIN_DB_PASSWORD}
- MYSQL_DATABASE=${MAIN_DB_NAME:-retoday}
volumes:
- mysql-data:/var/lib/mysql
ports:
- "3306:3306"
restart: unless-stopped
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
redis:
image: redis:alpine
container_name: retoday-redis
command: ["redis-server", "--appendonly", "yes"]
volumes:
- redis-data:/data
ports:
- "6379:6379"
restart: unless-stopped
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
api:
<<: *api-common
container_name: retoday-api
profiles: ["dev"]
api-blue:
<<: *api-common
container_name: retoday-api-blue
profiles: ["prod"]
api-green:
<<: *api-common
container_name: retoday-api-green
profiles: ["prod"]
nginx:
image: nginx:alpine
container_name: retoday-nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/proxy.conf:/etc/nginx/proxy.conf:ro
- ./nginx/upstream.conf:/etc/nginx/upstream.conf
- /etc/letsencrypt:/etc/letsencrypt:ro
- /var/www/certbot:/var/www/certbot:ro
restart: unless-stopped
healthcheck:
test: [ "CMD", "wget", "-qO-", "http://localhost/actuator/health" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
# batch:
# image: retoday-batch:latest
# container_name: retoday-batch
# env_file:
# - .env
# depends_on:
# mysql:
# condition: service_healthy
# restart: unless-stopped
volumes:
mysql-data:
redis-data: