forked from mkrou/smartdns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (19 loc) · 715 Bytes
/
Dockerfile
File metadata and controls
23 lines (19 loc) · 715 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM alpine:latest
RUN apk --no-cache add dnsmasq sniproxy iptables
ADD dnsmasq.conf /etc/dnsmasq.tpl
ADD sniproxy.conf /etc/sniproxy.conf
RUN ln -sf /dev/stdout /var/log/sniproxy/sniproxy.log
EXPOSE 53/udp
EXPOSE 80
EXPOSE 443
ENV IP 85.17.9.202
ENV ALLOWED_IP 0.0.0.0/0
CMD echo "Configure iptables..." && \
iptables -A INPUT --source ${ALLOWED_IP} --jump ACCEPT && \
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED --jump ACCEPT && \
iptables -P INPUT DROP && \
iptables -S && \
echo "Configure dnsmasq..." && \
sed "s/{IP}/${IP}/" /etc/dnsmasq.tpl > /etc/dnsmasq.conf && \
echo "Run sniproxy and dnsmasq..." && \
dnsmasq -khR & sniproxy -c /etc/sniproxy.conf -f