-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
171 lines (160 loc) · 7.18 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
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
160
161
162
163
164
165
166
167
168
169
170
171
services:
traefik:
image: traefik:latest
command:
- "--log.level=INFO"
- "--api.insecure=false"
- "--providers.docker=true"
- "--entrypoints.web.address=:80"
- "--entrypoints.websecure.address=:443"
- "--certificatesresolvers.myresolver.acme.httpchallenge=true"
- "--certificatesresolvers.myresolver.acme.httpchallenge.entrypoint=web"
- "--certificatesresolvers.myresolver.acme.email=${EMAIL}"
- "--certificatesresolvers.myresolver.acme.storage=/letsencrypt/acme.json"
network_mode: "host"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./letsencrypt:/letsencrypt"
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
# download subscribe link
nginx:
image: nginx:alpine
volumes:
- ./downloads:/usr/share/nginx/html/d
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx.rule=Host(`example.com`) && PathPrefix(`/d`)"
- "traefik.http.routers.nginx.entrypoints=websecure"
- "traefik.http.routers.nginx.tls.certresolver=myresolver"
- "traefik.http.middlewares.nginx-strip-prefix.stripPrefix.prefixes=/d"
- "traefik.http.services.nginx.loadbalancer.server.port=80"
xray:
# image: ghcr.io/v2fly/v2ray:v5.16.1
image: teddysun/xray
restart: always
environment:
- v2ray.vmess.aead.forced=false
volumes:
# v2ray
# - /root/v2ray_traefik/v2ray.json:/etc/v2ray/config.json
# - ./geosite.dat:/usr/local/share/v2ray/geosite.dat
# - ./geoip.dat:/usr/local/share/v2ray/geoip.dat
# xray
- ./v2ray.json:/etc/xray/config.json
- ./geosite.dat:/usr/local/share/xray/geosite.dat
- ./geoip.dat:/usr/local/share/xray/geoip.dat
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
network_mode: "host"
labels:
- "traefik.enable=true"
- "traefik.http.routers.v2ray.rule=Host(`${DOMAIN}`)"
- "traefik.http.routers.v2ray.entrypoints=websecure"
- "traefik.http.routers.v2ray.tls.certresolver=myresolver"
- "traefik.http.services.v2ray.loadbalancer.server.port=8388"
# WebSocket connection
- "traefik.http.routers.v2ray-ws1.rule=Host(`${DOMAIN}`) && PathPrefix(`/ws`)"
- "traefik.http.routers.v2ray-ws1.entrypoints=websecure"
- "traefik.http.routers.v2ray-ws1.tls.certresolver=myresolver"
- "traefik.http.routers.v2ray-ws1.middlewares=v2ray-headers"
- "traefik.http.routers.v2ray-ws1.service=v2ray-ws1"
- "traefik.http.services.v2ray-ws1.loadbalancer.server.port=8388"
# Public WebSocket connection
- "traefik.http.routers.v2ray-ws2.rule=Host(`${PUBLIC_DOMAIN}`) && PathPrefix(`/public_ws`)"
- "traefik.http.routers.v2ray-ws2.entrypoints=websecure"
- "traefik.http.routers.v2ray-ws2.tls.certresolver=myresolver"
- "traefik.http.routers.v2ray-ws2.middlewares=v2ray-headers"
- "traefik.http.routers.v2ray-ws2.service=v2ray-ws2"
- "traefik.http.services.v2ray-ws2.loadbalancer.server.port=8389"
# Friend WebSocket connection
- "traefik.http.routers.v2ray-ws3.rule=Host(`${DOMAIN}`) && PathPrefix(`/friend_ws`)"
- "traefik.http.routers.v2ray-ws3.entrypoints=websecure"
- "traefik.http.routers.v2ray-ws3.tls.certresolver=myresolver"
- "traefik.http.routers.v2ray-ws3.middlewares=v2ray-headers"
- "traefik.http.routers.v2ray-ws3.service=v2ray-ws3"
- "traefik.http.services.v2ray-ws3.loadbalancer.server.port=8390"
# VLESS WebSocket connection
- "traefik.http.routers.v2ray-vless.rule=Host(`${DOMAIN}`) && PathPrefix(`/vless_ws`)"
- "traefik.http.routers.v2ray-vless.entrypoints=websecure"
- "traefik.http.routers.v2ray-vless.tls.certresolver=myresolver"
- "traefik.http.routers.v2ray-vless.middlewares=v2ray-headers"
- "traefik.http.routers.v2ray-vless.service=v2ray-vless"
- "traefik.http.services.v2ray-vless.loadbalancer.server.port=8444"
# Reality connection
# - "traefik.tcp.routers.v2ray-reality.rule=HostSNI(`*`)"
# - "traefik.tcp.routers.v2ray-reality.entrypoints=reality"
# - "traefik.tcp.routers.v2ray-reality.service=v2ray-reality"
# - "traefik.tcp.services.v2ray-reality.loadbalancer.server.port=8447"
# Middleware applied to both routers
- "traefik.http.middlewares.v2ray-headers.headers.customrequestheaders.X-Forwarded-Proto=https"
v2ray-exporter:
image: wi1dcard/v2ray-exporter:master
container_name: v2ray-exporter
network_mode: "host"
command: ["--v2ray-endpoint", "127.0.0.1:10085"]
restart: unless-stopped
environment:
- TZ=Etc/UTC
depends_on:
- xray
prometheus:
container_name: prometheus
image: prom/prometheus:latest
network_mode: "host"
environment:
- TZ=Etc/UTC
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
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'
- '--web.listen-address=127.0.0.1:9091'
restart: unless-stopped
labels:
- "traefik.enable=true"
# - "traefik.http.routers.prometheus.rule=Host(`${DOMAIN}`) && PathPrefix(`/prometheus`)"
- "traefik.http.routers.prometheus.entrypoints=websecure"
- "traefik.http.routers.prometheus.tls.certresolver=myresolver"
- "traefik.http.services.prometheus.loadbalancer.server.port=9091"
- "traefik.http.routers.prometheus.middlewares=prometheus-stripprefix,prometheus-auth"
- "traefik.http.middlewares.prometheus-stripprefix.stripprefix.prefixes=/prometheus"
- "traefik.http.middlewares.prometheus-auth.basicauth.users=vpn:$$apr1$$dp7ert1j$$j3Q2CSiqkKUGEtjnnjvhP0" #vpn:WNB7tar@zvd7xpd3xcd
grafana:
container_name: grafana
image: grafana/grafana:latest
network_mode: "host"
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning:/etc/grafana/provisioning
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=password
- GF_USERS_ALLOW_SIGN_UP=false
- GF_SERVER_ROOT_URL=https://example.com/grafana
- GF_SERVER_SERVE_FROM_SUB_PATH=false
# - GF_AUTH_ANONYMOUS_ENABLED=true
# - GF_AUTH_ANONYMOUS_ORG_NAME=Main Org.
# - GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
- TZ=Etc/UTC
restart: unless-stopped
labels:
- "traefik.enable=true"
- "traefik.http.routers.grafana.rule=Host(`${DOMAIN}`) && PathPrefix(`/grafana`)"
- "traefik.http.routers.grafana.entrypoints=websecure"
- "traefik.http.routers.grafana.tls.certresolver=myresolver"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
- "traefik.http.middlewares.grafana-stripprefix.stripprefix.prefixes=/grafana"
- "traefik.http.routers.grafana.middlewares=grafana-stripprefix@docker"
volumes:
prometheus_data:
grafana_data: