generated from edwinvautier/go-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
128 lines (120 loc) · 2.42 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
version: '3'
services:
api:
build:
context: .
dockerfile: .docker/go/Dockerfile
ports:
- 8000:8000
restart: on-failure
volumes:
- ./:/go/src/github.com/HETIC-MT-P2021/CQRSES_GROUP3
depends_on:
- postgres
- rabbitmq
- es
networks:
- backend
environment:
- DB_USER=root
- DB_PASSWORD=root
- DB_NAME=db
- DB_HOST=postgres
- DB_PORT=5432
postgres:
image: postgres:latest
environment:
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- POSTGRES_DB=db
- DATABASE_HOST=postgres
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql/data
networks:
- backend
adminer:
image: adminer
ports:
- 8080:8080
depends_on:
- postgres
networks:
- backend
restart: unless-stopped
es:
image: docker.elastic.co/elasticsearch/elasticsearch:7.4.0
restart: always
ports:
- 9200:9200
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
environment:
- xpack.security.enabled=false
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 1g
networks:
- backend
kibana:
image: docker.elastic.co/kibana/kibana:7.4.0
restart: on-failure
ports:
- 5601:5601
environment:
ELASTICSEARCH_HOSTS: http://es:9200
networks:
- backend
rabbitmq:
image: rabbitmq:3-management
ports:
- "5672:5672"
- "15672:15672"
environment:
RABBITMQ_DEFAULT_USER: user
RABBITMQ_DEFAULT_PASS: bitnami
networks:
- backend
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:15672" ]
interval: 30s
timeout: 10s
retries: 5
app-consumer:
build:
context: .
dockerfile: .docker/consumer/Dockerfile
ports:
- 8082:8082
depends_on:
- rabbitmq
- es
links:
- rabbitmq
- es
volumes:
- ./:/go/src/github.com/HETIC-MT-P2021/CQRSES_GROUP3/
tty: true
environment:
- DB_USER=root
- DB_PASSWORD=root
- DB_NAME=db
- DB_HOST=postgres
- DB_PORT=5432
networks:
- backend
volumes:
api:
postgres:
elasticsearch-data:
driver: local
rmq_data:
driver: local
# Networks to be created to facilitate communication between containers
networks:
backend:
driver: bridge