-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompose.yaml
63 lines (58 loc) · 1.15 KB
/
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
name: guestbook-demo
services:
guestbook:
build: .
container_name: guestbook
command:
- --db-name=postgres
- --db-host=postgres
- --db-password=password
- --db-user=postgres
- --redis-host=redis
- --redis-password=password
depends_on:
postgres:
condition: service_started
redis:
condition: service_started
healthcheck:
test: ["CMD", "curl", "http://localhost:8080"]
interval: 10s
timeout: 5s
retries: 3
start_period: 3s
networks:
- guestbook-network
ports:
- 8080:8080
restart: unless-stopped
postgres:
container_name: postgres
environment:
- POSTGRES_PASSWORD=password
ports:
- 5432:5432
image: postgres:12
networks:
- guestbook-network
restart: unless-stopped
volumes:
- db-data:/data
redis:
container_name: redis
ports:
- 6379:6379
image: redis:5
networks:
- guestbook-network
restart: unless-stopped
volumes:
- redis-data:/data
command:
- "--appendonly yes"
- --requirepass password
networks:
guestbook-network:
volumes:
db-data:
redis-data: