-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
163 lines (153 loc) · 3.86 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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
services:
api-gateway:
container_name: api-gateway
image: api-gateway:1.0.0
build:
context: .
dockerfile: ./backend/api-gateway/api_gateway.dockerfile
ports:
- 8080:8080
environment:
- JWT_SECRET=your-secret-key
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=yourredispassword
volumes:
- ./backend/api-gateway:/app
depends_on:
- redis
domain-service:
container_name: domain-service
build:
context: ./backend/domain-service
dockerfile: domain-service.dockerfile
ports:
- "5000:5000"
environment:
- DATABASE_URL=postgresql://user:password@db/domain_service
- SECRET_KEY=your_secret_key_here
- FLASK_ENV=development
- DEBUG=True
- RABBITMQ_HOST=rabbitmq
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
dns-service:
container_name: dns-service
build:
context: ./backend/dns-service
dockerfile: dns-service.dockerfile
ports:
- "5001:5001"
environment:
- DATABASE_URL=postgresql://user:password@db/dns_service
- SECRET_KEY=your_secret_key_here
- FLASK_ENV=development
- FLASK_DEBUG=1
- DEBUG=True
- RABBITMQ_HOST=rabbitmq
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
whois-service:
container_name: whois-service
build:
context: ./backend/whois-service
dockerfile: whois-service.dockerfile
ports:
- "5002:5002"
environment:
- DATABASE_URL=postgresql://user:password@db/whois_service
- SECRET_KEY=your_secret_key_here
- FLASK_ENV=development
- FLASK_DEBUG=1
- DEBUG=True
- RABBITMQ_HOST=rabbitmq
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
notification-service:
container_name: notification-service
build:
context: ./backend/notification-service
dockerfile: notification-service.dockerfile
ports:
- "5003:5003"
environment:
- DATABASE_URL=postgresql://user:password@db/notification_service
- SECRET_KEY=your_secret_key_here
- FLASK_ENV=development
- FLASK_DEBUG=1
- DEBUG=True
- RABBITMQ_HOST=rabbitmq
depends_on:
db:
condition: service_healthy
rabbitmq:
condition: service_healthy
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: frontend.dockerfile
ports:
- "3010:3010"
volumes:
- ./frontend:/app
- /app/node_modules
- /app/.next
environment:
- NODE_ENV=development
command: npm run dev
db:
container_name: dm-db
image: postgres:13
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
environment:
- POSTGRES_DB=dns_service
- POSTGRES_USER=user
- POSTGRES_PASSWORD=password
command: >
bash -c "
chmod +x /docker-entrypoint-initdb.d/init-db.sh &&
docker-entrypoint.sh postgres
"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U user -d whois_service"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "-q", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- rabbitmq_data:/var/lib/rabbitmq
redis:
image: redis:6.2-alpine
container_name: redis
restart: always
ports:
- '6379:6379'
command: redis-server --save 20 1 --loglevel warning --requirepass yourredispassword
volumes:
- redis_data:/data
volumes:
postgres_data:
rabbitmq_data:
redis_data: