-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
125 lines (117 loc) · 2.58 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
version: "3"
services:
backend_service:
build:
context: backend_service
dockerfile: backend_service/Dockerfile.dev
ports:
- "8080:8080"
env_file:
- backend_service/.env
volumes:
- ./backend_service/:/app
networks:
- micro_backends
depends_on:
- mongo_service
- postgres_service
- rabbitmq
mongo_service:
build:
context: mongo_service
dockerfile: mongo_service/Dockerfile.dev
ports:
- "8081:8081"
env_file:
- mongo_service/.env
volumes:
- ./mongo_service/:/app
networks:
- micro_backends
depends_on:
- rabbitmq
- mongodb
postgres_service:
build:
context: postgres_service
dockerfile: postgres_service/Dockerfile.dev
ports:
- "8082:8082"
env_file:
- postgres_service/.env
volumes:
- ./postgres_service/:/app
networks:
- micro_backends
depends_on:
- rabbitmq
- postgres
rabbitmq:
image: rabbitmq:management
restart: always
ports:
# AMQP protocol port
- "5673:5672"
# HTTP management UI
- "15673:15672"
environment:
RABBITMQ_DEFAULT_USER: rabbitmq
RABBITMQ_DEFAULT_PASS: rabbitmq
volumes:
- rabbitmq:/var/lib/rabbitmq
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 5s
retries: 5
networks:
- micro_backends
mongodb:
image: bitnami/mongodb:latest
restart: always
ports:
- "27018:27017"
environment:
MONGODB_ROOT_USER: mongo
MONGODB_ROOT_PASSWORD: mongo
MONGODB_USERNAME: mongo
MONGODB_PASSWORD: mongo
MONGODB_DATABASE: micro_backends
volumes:
- mongodb:/bitnami/mongodb
healthcheck:
test: echo 'db.runCommand({serverStatus:1}).ok' | mongo -u mongo -p mongo --quiet | grep 1
interval: 10s
timeout: 5s
retries: 5
networks:
- micro_backends
postgres:
image: postgres:latest
restart: always
ports:
- "5433:5432"
environment:
POSTGRES_DB: micro_backends
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- postgres:/var/lib/postgresql/data
- ./postgres_service/init/database.sql:/docker-entrypoint-initdb.d/init.sql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
- micro_backends
volumes:
backend_service:
mongo_service:
postgres_service:
rabbitmq:
mongodb:
postgres:
networks:
micro_backends:
driver: bridge