dominiciao commited on
Commit
7a3e60d
·
verified ·
1 Parent(s): 2aab760

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM alpine:latest
2
+
3
+ RUN set -ex && apk add --no-cache curl wireproxy-tools
4
+
5
+ ADD https://github.com/ViRb3/wgcf/releases/download/v2.2.30/wgcf_2.2.30_linux_amd64 /usr/local/bin/wgcf
6
+ RUN chmod +x /usr/local/bin/wgcf
7
+
8
+ WORKDIR /config
9
+ RUN wgcf register --accept-tos && wgcf generate
10
+
11
+ RUN cat > /wireproxy.conf << 'EOF'
12
+ [Interface]
13
+ Address = $(grep -m1 Address /config/wgcf-profile.conf | cut -d' ' -f3)
14
+ DNS = 1.1.1.1
15
+ MTU = 1280
16
+ PrivateKey = $(grep PrivateKey /config/wgcf-profile.conf | cut -d' ' -f3)
17
+
18
+ [Peer]
19
+ PublicKey = $(grep PublicKey /config/wgcf-profile.conf | cut -d' ' -f3)
20
+ Endpoint = 162.159.192.1:2408
21
+ AllowedIPs = 0.0.0.0/0
22
+ PersistentKeepalive = 25
23
+
24
+ [SOCKS5]
25
+ BindAddress = 127.0.0.1:1080
26
+ EOF
27
+
28
+ COPY api-server /app/api-server
29
+ RUN chmod +x /app/api-server
30
+
31
+ WORKDIR /app
32
+ EXPOSE 7860
33
+
34
+ RUN echo '#!/bin/sh' > /start.sh && \
35
+ echo 'wireproxy -config /wireproxy.conf &' >> /start.sh && \
36
+ echo 'sleep 3' >> /start.sh && \
37
+ echo 'echo "{\"server_host\": \"0.0.0.0\", \"server_port\": 7860, \"server_key\": \"'${SERVER_KEY}'\", \"upstream_server\": \"socks5://127.0.0.1:1080\"}" > config.json' >> /start.sh && \
38
+ echo './api-server -config config.json' >> /start.sh && \
39
+ chmod +x /start.sh
40
+
41
+ CMD ["/start.sh"]