This repository was archived by the owner on Jul 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
156 lines (145 loc) · 4.21 KB
/
docker-compose.yaml
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
version: '3.8'
x-jellyfish-template: &jellyfish-template
image: "ghcr.io/jellyfish-dev/jellyfish:${JELLYFISH_VERSION:-edge}"
restart: unless-stopped
environment: &jellyfish-environment
JF_SERVER_API_TOKEN: ${JF_SERVER_API_TOKEN:-development}
JF_CHECK_ORIGIN: "${JF_CHECK_ORIGIN:-false}"
JF_DIST_ENABLED: "${JF_DIST_ENABLED:-true}"
JF_DIST_NODES: "app@jellyfish1 app@jellyfish2"
JF_WEBRTC_TURN_IP: $EXTERNAL_IP
JF_WEBRTC_TURN_LISTEN_IP: "0.0.0.0"
services:
jellyfish1:
<<: *jellyfish-template
container_name: jellyfish1
environment:
<<: *jellyfish-environment
JF_HOST: "${JF1_HOST:-${JF1_IP:-$EXTERNAL_IP}:5002}"
JF_PORT: 5002
JF_DIST_NODE_NAME: app@jellyfish1
JF_WEBRTC_TURN_PORT_RANGE: "50000-50100"
JF_WEBRTC_TURN_TCP_PORT: "49999"
ports:
- "5002:5002"
- "49999:49999"
- "50000-50100:50000-50100/udp"
jellyfish2:
<<: *jellyfish-template
restart: unless-stopped
container_name: jellyfish2
environment:
<<: *jellyfish-environment
JF_HOST: "${JF2_HOST:-${JF2_IP:-$EXTERNAL_IP}:5003}"
JF_PORT: 5003
JF_DIST_NODE_NAME: app@jellyfish2
JF_WEBRTC_TURN_PORT_RANGE: "50101-50200"
JF_WEBRTC_TURN_TCP_PORT: "49998"
ports:
- "5003:5003"
- "49998:49998"
- "50101-50200:50101-50200/udp"
frontend:
build:
context: ./assets
dockerfile: ./Dockerfile
args:
FE_BE_HOST: ${BE_HOST:-$DOMAIN:5004}
JELLYFISH_VERSION: ${JELLYFISH_VERSION:-0.3.0}
JELLYROOM_VERSION: ${JELLYROOM_VERSION:-build}
container_name: frontend
restart: unless-stopped
depends_on:
- backend
- jellyfish1
- jellyfish2
ports:
- "5005:5005"
backend:
build:
context: .
dockerfile: ./Dockerfile
container_name: backend
environment:
BE_PORT: 5004
BE_HOST: ${BE_HOST:-$DOMAIN}
BE_PHX_SERVER: "true"
BE_JF_ADDRESSES: ${BE_JF_ADDRESSES:-jellyfish1:5002 jellyfish2:5003}
BE_JF_SECURE_CONNECTION: ${BE_JF_SECURE_CONNECTION:-false}
BE_JF_SERVER_API_TOKEN: ${JF_SERVER_API_TOKEN:-development}
restart: unless-stopped
depends_on:
- jellyfish1
- jellyfish2
ports:
- "5004:5004"
prometheus:
build:
context: ./prometheus
dockerfile: Dockerfile
args:
PROM_JELLYFISH_TARGETS: ${PROM_JELLYFISH_TARGETS:-jellyfish1:9568,jellyfish2:9568}
# Through 172.17.0.1 address docker containers (not running in network mode host) can access
# services running on host OS (localhost). In this example through this address prometheus could access
# node-exporter which is running in network mode host.
PROM_NODE_TARGETS: '172.17.0.1:9100'
container_name: prometheus
restart: on-failure
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
volumes:
- prometheus_data:/prometheus
depends_on:
- jellyfish1
- jellyfish2
grafana:
build:
context: ./grafana
dockerfile: Dockerfile
container_name: grafana
restart: on-failure
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
environment:
GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD}"
GF_SECURITY_ADMIN_USER: "${GF_SECURITY_ADMIN_USER}"
ports:
- '3000:3000'
expose:
- 3000
node-exporter:
image: prom/node-exporter:v1.6.1
container_name: node_exporter
restart: on-failure
network_mode: host
command:
- --path.rootfs=/host
volumes:
- /:/host:ro,rslave
loki:
build:
context: ./loki
dockerfile: Dockerfile
volumes:
- loki_data:/loki
ports:
- "3100:3100"
promtail:
build:
context: ./promtail
dockerfile: Dockerfile
args:
LOKI_ADDRESS: loki
volumes:
# to read container labels and logs
- /var/run/docker.sock:/var/run/docker.sock
- /var/lib/docker/containers:/var/lib/docker/containers
volumes:
grafana_data: {}
prometheus_data: {}
loki_data: {}