-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
126 lines (120 loc) · 3.43 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
# Version is now obsolete. This compose configuration assumes version 3.8.
name: cssu-orientation
x-logging: &logging
logging:
driver: 'json-file'
options:
max-file: '10'
max-size: '1gb'
networks:
orientation:
driver: bridge
services:
orientation_app:
build:
context: .
dockerfile: Dockerfile
container_name: orientation-app
restart: unless-stopped
stop_signal: SIGINT
stop_grace_period: 5m
tty: true
depends_on:
postgres:
condition: service_healthy
redis_ephemeral:
condition: service_healthy
redis_persistent:
condition: service_healthy
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:3000/api/health']
interval: 10s
timeout: 5s
start_period: 10s
retries: 5
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
ports:
- 127.0.0.1:3000:3000
env_file:
- .env
environment:
- DATABASE_URL=postgresql://orientation:${POSTGRES_PASSWORD}@postgres:5432
networks:
- orientation
<<: *logging
postgres:
image: postgres:latest
container_name: postgres-orientation
pull_policy: always
restart: unless-stopped
stop_signal: SIGINT
stop_grace_period: 5m
tty: true
shm_size: 256mb
healthcheck:
test: ['CMD-SHELL', 'pg_isready']
interval: 60s
timeout: 5s
retries: 5
start_period: 40s
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /var/lib/orientation-app/db:/var/lib/postgresql/data:rw
ports:
- 127.0.0.1:5432:5432
environment:
- POSTGRES_USER=orientation
env_file:
- .env
networks:
- orientation
<<: *logging
redis_ephemeral:
image: redis:latest
container_name: redis-ephemeral-orientation
pull_policy: always
restart: unless-stopped
stop_signal: SIGINT
stop_grace_period: 5m
tty: true
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 60s
timeout: 5s
retries: 3
start_period: 40s
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
ports:
- 127.0.0.1:6379:6379
networks:
- orientation
<<: *logging
redis_persistent:
image: redis:latest
container_name: redis_persistent-orientation
command: redis-server --appendonly yes
pull_policy: always
restart: unless-stopped
stop_signal: SIGINT
stop_grace_period: 5m
tty: true
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 60s
timeout: 5s
retries: 3
start_period: 40s
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /var/lib/orientation-app/redisdb:/data:rw
ports:
- 127.0.0.1:6380:6379
networks:
- orientation
<<: *logging