-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.prod.yaml
More file actions
138 lines (129 loc) · 3.25 KB
/
Copy pathdocker-compose.prod.yaml
File metadata and controls
138 lines (129 loc) · 3.25 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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
services:
blue:
image: ${ECR_REGISTRY}:${IMAGE_TAG:-latest}
container_name: ditda-blue
profiles: [ "blue" ]
restart: unless-stopped
labels:
ditda.logs.app: "ditda"
ditda.logs.service: "ditda-api"
ports:
- "127.0.0.1:8081:8080"
env_file: .env
depends_on:
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- ditda-net
healthcheck:
test: [ "CMD-SHELL", "wget -qO- http://localhost:8080/actuator/health || exit 1" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
green:
image: ${ECR_REGISTRY}:${IMAGE_TAG:-latest}
container_name: ditda-green
profiles: [ "green" ]
restart: unless-stopped
labels:
ditda.logs.app: "ditda"
ditda.logs.service: "ditda-api"
ports:
- "127.0.0.1:8082:8080"
env_file: .env
depends_on:
redis:
condition: service_healthy
rabbitmq:
condition: service_healthy
networks:
- ditda-net
healthcheck:
test: [ "CMD-SHELL", "wget -qO- http://localhost:8080/actuator/health || exit 1" ]
interval: 30s
timeout: 5s
retries: 3
start_period: 60s
redis:
image: redis:8.6-alpine
container_name: ditda-redis
restart: unless-stopped
command:
- redis-server
- --requirepass
- ${REDIS_PASSWORD}
- --appendonly
- "yes"
- --maxmemory
- "256mb"
- --maxmemory-policy
- "allkeys-lru"
volumes:
- redis-data:/data
networks:
- ditda-net
healthcheck:
test: [ "CMD", "redis-cli", "-a", "${REDIS_PASSWORD}", "ping" ]
interval: 10s
timeout: 3s
retries: 5
redis-exporter:
image: oliver006/redis_exporter:v1.88.0-alpine
container_name: ditda-redis-exporter
restart: unless-stopped
environment:
REDIS_ADDR: redis://ditda-redis:6379
REDIS_PASSWORD: ${REDIS_PASSWORD}
networks:
- ditda-net
depends_on:
redis:
condition: service_healthy
rabbitmq:
image: rabbitmq:4.3.2-management-alpine
container_name: ditda-rabbitmq
restart: unless-stopped
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USERNAME}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
volumes:
- rabbitmq-data:/var/lib/rabbitmq
networks:
- ditda-net
healthcheck:
test: [ "CMD", "rabbitmq-diagnostics", "-q", "ping" ]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
nginx:
image: nginx:1.27-alpine
container_name: ditda-nginx
restart: unless-stopped
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./nginx/conf.d:/etc/nginx/conf.d
- ./nginx/certbot/conf:/etc/letsencrypt
- ./nginx/certbot/www:/var/www/certbot
networks:
- ditda-net
certbot:
image: certbot/certbot:latest
container_name: ditda-certbot
volumes:
- ./nginx/certbot/conf:/etc/letsencrypt
- ./nginx/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
networks:
ditda-net:
name: ditda-net
driver: bridge
volumes:
redis-data:
rabbitmq-data: