forked from Josh5/lancache-bundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
102 lines (81 loc) · 2.75 KB
/
Dockerfile
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
FROM lancachenet/monolithic:latest
LABEL maintainer="Josh.5 <[email protected]>"
# This Dockerfile is designed to simply pull together the docker-compose
# lancache project into a single image.
# It is not supposed to over complicate things or re-invent the wheel.
# As such, it will be based on their monolithic docker image and will install
# the various DNS and sniproxy components on top.
#
# In order to simply maintenance of this docker image in comparison to the
# upstream sniproxy and DNS components, some parts such as the ENV variables
# may be repeated. This is fine as it is not a production docker image, but
# is designed for personal home use only.
#
# lancache-monolithic env variables
ENV GENERICCACHE_VERSION=2 \
CACHE_MODE=monolithic \
WEBUSER=www-data \
CACHE_MEM_SIZE=500m \
CACHE_DISK_SIZE=1000000m \
CACHE_MAX_AGE=3560d \
CACHE_SLICE_SIZE=1m \
UPSTREAM_DNS="8.8.8.8" \
BEAT_TIME=1h \
LOGFILE_RETENTION=3560 \
CACHE_DOMAINS_REPO="https://github.com/uklans/cache-domains.git" \
CACHE_DOMAINS_BRANCH=master \
NGINX_WORKER_PROCESSES=auto
# lancache-dns env variables
ENV STEAMCACHE_DNS_VERSION=1 \
ENABLE_DNSSEC_VALIDATION=false \
LANCACHE_DNSDOMAIN=cache.lancache.net \
CACHE_DOMAINS_REPO=https://github.com/uklans/cache-domains.git \
CACHE_DOMAINS_BRANCH=master \
UPSTREAM_DNS=8.8.8.8
# Install dependencies
RUN \
apt-get update \
&& apt-get install -y \
jq \
curl \
git \
&& \
echo "**** Clone cache-domains ****" \
&& git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains /opt/cache-domains \
&& \
echo "**** Cleanup files ****" \
&& rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/*
# Install dns and bind
RUN \
echo "**** Install dns and bind ****" \
&& apt-get update \
&& apt-get install -y \
bind9 \
dnsutils \
&& \
echo "**** Install lancache-dns configs ****" \
&& git clone --depth=1 https://github.com/lancachenet/lancache-dns /tmp/lancache-dns \
&& cp -rfv /tmp/lancache-dns/overlay/* / \
&& mkdir -p /var/cache/bind /var/log/named \
&& chown bind:bind \
/var/cache/bind \
/var/log/named \
&& \
echo "**** Set permissions ****" \
&& chmod 755 /scripts/* \
&& \
echo "**** Cleanup setup files ****" \
&& rm -rf /tmp/* \
&& rm -rf /var/lib/apt/lists/*
# Copy in any local config files
COPY overlay/ /
# Set the DNS_BIND_IP to the local host because all the services are now running together...
ENV DNS_BIND_IP=127.0.0.1
# Set ports to expose
EXPOSE 80
EXPOSE 53/udp
EXPOSE 443
# Set volumes that are required
VOLUME ["/var/log", "/data/cache", "/var/www"]
WORKDIR /scripts