-
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathdocker-compose.yml
78 lines (71 loc) · 1.4 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
71
72
73
74
75
76
77
78
---
version: "3.8"
services:
redis:
image: redis:alpine
command: redis-server --requirepass password
ports: ["6379"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- frontend
- backend
postgres:
image: postgres:14.1
ports:
- "5432:5432"
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: voting-app-db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- frontend
- backend
volumes:
- "db-data:/var/lib/postgresql/data"
result-webapp:
build:
context: ./voting-app/result-webapp
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
networks:
- frontend
ports:
- "9091:80"
vote-webapp:
build:
context: ./voting-app/vote-webapp
dockerfile: Dockerfile
depends_on:
redis:
condition: service_healthy
networks:
- frontend
ports:
- "9090:80"
worker:
build:
context: ./voting-app/worker
dockerfile: Dockerfile
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- backend
networks:
frontend:
backend:
volumes:
db-data: {}