-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-entrypoint.sh
94 lines (90 loc) · 2.22 KB
/
docker-entrypoint.sh
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
#!/bin/bash
# ulimit -SHc unlimited
# ulimit -SHu unlimited
# ulimit -SHs unlimited
# ulimit -SHl unlimited
# ulimit -SHi unlimited
# ulimit -SHq unlimited
# ulimit -SHn 655360
cat <<-EOF > /etc/sing-box/vmess.json
{
"log":{
"level":"info"
},
"inbounds":[
{
"type":"vmess",
"tag":"vmess-in",
"listen":"::",
"listen_port":${VMESS_PORT},
"tcp_fast_open":true,
"udp_fragment":true,
"sniff":true,
"sniff_override_destination":true,
"proxy_protocol":false,
"proxy_protocol_accept_no_header":false,
"users":[
{
"name":"${VMESS_NAME}",
"uuid":"${VMESS_UUID}",
"alterId":${VMESS_ALTER_ID}
}
],
"transport":{
"type":"ws",
"path":"${VMESS_WSPATH}",
"max_early_data":0,
"early_data_header_name":"Sec-WebSocket-Protocol"
}
}
],
"outbounds":[
{
"type":"direct",
"tag":"direct"
}
]
}
EOF
cat <<-EOF > /etc/sing-box/trojan.json
{
"log":{
"level":"info"
},
"inbounds":[
{
"type":"trojan",
"tag":"trojan-in",
"listen":"::",
"listen_port":${TROJAN_PORT},
"tcp_fast_open":true,
"udp_fragment":true,
"sniff":true,
"sniff_override_destination":true,
"udp_timeout":300,
"proxy_protocol":false,
"proxy_protocol_accept_no_header":false,
"users":[
{
"name":"${TROJAN_NAME}",
"password":"${TROJAN_PWD}"
}
],
"transport":{
"type":"ws",
"path":"${TROJAN_WSPATH}",
"max_early_data":0,
"early_data_header_name":"Sec-WebSocket-Protocol"
}
}
],
"outbounds":[
{
"type":"direct",
"tag":"direct"
}
]
}
EOF
# 运行supervisord
exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf