-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
159 lines (150 loc) · 3.42 KB
/
docker-compose.yml
File metadata and controls
159 lines (150 loc) · 3.42 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
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
x-logging-and-limits: &high-perf
ulimits:
nofile:
soft: 65535
hard: 65535
sysctls:
- net.core.somaxconn=8192
- net.ipv4.tcp_max_syn_backlog=8192
- net.ipv4.tcp_fin_timeout=25
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
x-logging-minimal: &minimal-perf
logging:
driver: "json-file"
options:
max-size: "5m"
max-file: "1"
services:
xray-config:
build:
context: ./xray-config
dockerfile: Dockerfile
restart: always
<<: *minimal-perf
env_file:
- env_file
environment:
- TZ=UTC
- PYTHONPATH=/
volumes:
- "/etc/machine-id:/host/etc/machine-id"
- "acme:/root/.acme.sh/"
- "./shared_lib:/shared_lib:ro"
- "./env_file:/root/env_file:ro"
- "/var/log/compassvpn:/var/log/compassvpn:rw"
xray:
build:
context: ./xray
dockerfile: Dockerfile
<<: *high-perf
volumes:
- "/var/log/compassvpn:/var/log/compassvpn:rw"
- "./shared_lib:/shared_lib:ro"
- "./env_file:/env_file:ro"
cap_add:
- NET_ADMIN
restart: always
env_file:
- env_file
environment:
- TZ=UTC
- PYTHONPATH=/
depends_on:
- xray-config
ports:
- "8080:8080/tcp"
- "8080:8080/udp"
- "443:443/tcp"
- "443:443/udp"
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
<<: *high-perf
volumes:
- "acme:/root/.acme.sh/"
- "/var/log/compassvpn:/var/log/compassvpn:rw"
- "/var/log/nginx:/var/log/nginx:rw"
- "./shared_lib:/shared_lib:ro"
restart: always
env_file:
- env_file
ports:
- "8880:8880/tcp"
- "8880:8880/udp"
- "2053:2053/tcp"
- "2053:2053/udp"
- "8443:8443/tcp"
- "8443:8443/udp"
environment:
- TZ=UTC
- PYTHONPATH=/
depends_on:
- xray
xray-exporter:
build:
context: ./xray-exporter
dockerfile: Dockerfile
restart: always
<<: *minimal-perf
depends_on:
- xray
volumes:
- /var/log/compassvpn:/var/log/compassvpn:ro
- "./shared_lib:/shared_lib:ro"
ports:
- "9550:9550"
environment:
- LOG_LEVEL=info
- PYTHONPATH=/
metric-forwarder:
build:
context: ./metric-forwarder
dockerfile: Dockerfile
restart: always
<<: *minimal-perf
env_file:
- env_file
environment:
- TZ=UTC
- PYTHONPATH=/
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- "./shared_lib:/shared_lib:ro"
- "./env_file:/env_file:ro"
depends_on:
- xray-config
- node-exporter
node-exporter:
image: prom/node-exporter:v1.9.1
restart: always
network_mode: host
<<: *minimal-perf
volumes:
- "/proc:/host/proc:ro"
- "/sys:/host/sys:ro"
- "/:/rootfs:ro"
- "/var/run/docker.sock:/var/run/docker.sock"
environment:
- TZ=UTC
command:
- "--log.level=warn"
- "--path.procfs=/host/proc"
- "--path.sysfs=/host/sys"
- '--collector.disable-defaults'
- '--collector.uname'
- '--collector.cpu'
- '--collector.meminfo'
- '--collector.filesystem'
- '--collector.netdev'
- '--collector.time'
- '--collector.stat'
- '--collector.pressure'
- "--web.listen-address=172.17.0.1:9100" # only allow access from host.docker.internal interface
volumes:
acme: