This repository was archived by the owner on Mar 15, 2022. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (106 loc) · 3.29 KB
/
Copy pathdocker-compose.yml
File metadata and controls
115 lines (106 loc) · 3.29 KB
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
version: "3.5"
networks:
main:
name: minitwit-network
services:
db:
image: postgres
networks:
- main
expose:
- "5432"
ports:
- "5432:5432"
# Upon startup, it will create a Postgress user 'docker' with password 'docker',
# and a database called 'minitwit'.
environment:
- POSTGRES_USER=docker
- POSTGRES_PASSWORD=docker
- POSTGRES_DB=minitwit
simulator-api:
build: ./backend
networks:
- main
ports:
- "5001:5001"
command: bash -c "/wait && npm run simulator"
depends_on:
- db
- filebeat
environment:
- PSQL_DB_NAME=minitwit # Must be the same as 'POSTGRES_DB' in 'db' service
- PSQL_DB_USER_NAME=docker # Must be the same as 'POSTGRES_USER' in 'db' service
- PSQL_DB_USER_PASSWORD=docker # Must be the same as 'POSTGRES_PASSWORD' in 'db' service
- PSQL_HOST_NAME=db # Must be the same as the name of the 'db' service
- WAIT_HOSTS=db:5432
custom-api:
build: ./backend
networks:
- main
ports:
- "5002:5001"
command: bash -c "/wait && npm start"
depends_on:
- db
environment:
- PSQL_DB_NAME=minitwit # Must be the same as 'POSTGRES_DB' in 'db' service
- PSQL_DB_USER_NAME=docker # Must be the same as 'POSTGRES_USER' in 'db' service
- PSQL_DB_USER_PASSWORD=docker # Must be the same as 'POSTGRES_PASSWORD' in 'db' service
- PSQL_HOST_NAME=db # Must be the same as the name of the 'db' service
- WAIT_HOSTS=db:5432
frontend:
build: ./frontend
networks:
- main
ports:
- "3000:3000"
depends_on:
- custom-api
# From: https://github.com/stefanprodan/dockprom/blob/master/docker-compose.yml
node-exporter:
image: prom/node-exporter
volumes:
- /proc:/host/proc:ro
- /sys:/host/sys:ro
- /:/rootfs:ro
command:
- "--path.procfs=/host/proc"
- "--path.rootfs=/rootfs"
- "--path.sysfs=/host/sys"
- "--collector.filesystem.ignored-mount-points=^/(sys|proc|dev|host|etc)($$|/)"
ports:
- "9100:9100"
networks:
- main
prometheus:
image: prom/prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- main
depends_on:
- simulator-api
- custom-api
- node-exporter
grafana:
build: ./grafana
ports:
- "3001:3000"
networks:
- main
depends_on:
- prometheus
filebeat:
image: docker.elastic.co/beats/filebeat:7.6.1
user: root
volumes:
- ./filebeat.yml:/usr/share/filebeat/filebeat.yml
- /var/lib/docker/containers:/var/lib/docker/containers
- /var/run/docker.sock:/var/run/docker.sock
environment:
- -strict.perms=false
- LOGSTASH_HOST=logstash
networks:
- main