-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
70 lines (65 loc) · 1.8 KB
/
docker-compose.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
version: '2.1'
x-redis-conf-producer-volume: &redis-conf-producer-volume 'redis-config:/config:rw'
x-redis-conf-consumer-volume: &redis-conf-consumer-volume 'redis-config:/config:ro'
x-redis-conf-file: &redis-conf-file '/config/redis.conf'
x-redis-port: &redis-port '6379'
x-redis-port-mapping: &redis-port-mapping '6379:6379'
x-redis-data-dir: &redis-data-dir '/data'
x-helper-dir: &helper-dir '/helper'
x-helper-wrapper-script: &helper-wrapper-script '/helper/run.sh'
x-helper-dockerize: &helper-dockerize '/helper/dockerize'
volumes:
redis-config:
services:
helper:
image: '${IMAGE_REGISTRY:-abrarov}/redis-helper:${PROJECT_VERSION:-1.2.0}'
read_only: true
volumes:
- *helper-dir
init:
image: '${IMAGE_REGISTRY:-abrarov}/redis-init:${PROJECT_VERSION:-1.2.0}'
command: *helper-wrapper-script
environment:
INIT_COMMAND: '/run.sh'
REDIS_CONFIG_FILE: *redis-conf-file
REDIS_PORT: *redis-port
REDIS_LISTEN_BACKLOG: '128'
REDIS_PROTECTED_MODE: 'no'
REDIS_DATA_DIR: *redis-data-dir
read_only: true
volumes:
- '/tmp'
- *redis-conf-producer-volume
volumes_from:
- 'helper:ro'
redis:
image: '${IMAGE_REGISTRY:-abrarov}/redis:${REDIS_VERSION:-6.2.6}-${PROJECT_VERSION:-1.2.0}'
command:
- *helper-dockerize
- '-wait'
- 'tcp://init:8080'
- '-timeout'
- '60s'
- 'redis-server'
- *redis-conf-file
healthcheck:
test:
- 'CMD'
- 'redis-cli'
- '-h'
- '127.0.0.1'
- '-p'
- *redis-port
- 'ping'
interval: '30s'
timeout: '5s'
retries: 3
read_only: true
volumes:
- '/tmp'
- *redis-conf-consumer-volume
- *redis-data-dir
volumes_from:
- 'helper:ro'
ports:
- *redis-port-mapping