2021-07-20 12:04:38 +00:00
|
|
|
FROM lancachenet/ubuntu-nginx:latest
|
|
|
|
LABEL version=3
|
2021-10-08 23:11:15 +00:00
|
|
|
LABEL description="Single caching container for caching game content at LAN parties."
|
|
|
|
LABEL maintainer="LanCache.Net Team <team@lancache.net>"
|
2018-11-28 22:35:06 +00:00
|
|
|
|
2022-11-12 12:10:20 +00:00
|
|
|
RUN apt-get update ;\
|
|
|
|
apt-get install -y jq git ;
|
|
|
|
|
2020-02-24 12:17:25 +00:00
|
|
|
ENV GENERICCACHE_VERSION=2 \
|
|
|
|
CACHE_MODE=monolithic \
|
|
|
|
WEBUSER=www-data \
|
2021-10-09 10:24:38 +00:00
|
|
|
CACHE_INDEX_SIZE=500m \
|
2022-09-10 19:04:09 +00:00
|
|
|
CACHE_DISK_SIZE=1000g \
|
2024-05-29 02:07:56 +00:00
|
|
|
MIN_FREE_DISK=10g \
|
2020-02-24 12:17:25 +00:00
|
|
|
CACHE_MAX_AGE=3560d \
|
|
|
|
CACHE_SLICE_SIZE=1m \
|
|
|
|
UPSTREAM_DNS="8.8.8.8 8.8.4.4" \
|
|
|
|
BEAT_TIME=1h \
|
|
|
|
LOGFILE_RETENTION=3560 \
|
|
|
|
CACHE_DOMAINS_REPO="https://github.com/uklans/cache-domains.git" \
|
|
|
|
CACHE_DOMAINS_BRANCH=master \
|
2023-02-24 08:46:49 +00:00
|
|
|
NGINX_WORKER_PROCESSES=auto \
|
|
|
|
NGINX_LOG_FORMAT=cachelog
|
2018-11-28 22:35:06 +00:00
|
|
|
|
|
|
|
COPY overlay/ /
|
|
|
|
|
2021-07-20 12:04:38 +00:00
|
|
|
RUN rm /etc/nginx/sites-enabled/* /etc/nginx/stream-enabled/* ;\
|
|
|
|
rm /etc/nginx/conf.d/gzip.conf ;\
|
|
|
|
chmod 754 /var/log/tallylog ; \
|
|
|
|
id -u ${WEBUSER} &> /dev/null || adduser --system --home /var/www/ --no-create-home --shell /bin/false --group --disabled-login ${WEBUSER} ;\
|
2024-05-06 20:19:25 +00:00
|
|
|
chmod 755 /scripts/* ;\
|
2022-11-12 12:10:20 +00:00
|
|
|
mkdir -m 755 -p /data/cache ;\
|
|
|
|
mkdir -m 755 -p /data/info ;\
|
|
|
|
mkdir -m 755 -p /data/logs ;\
|
|
|
|
mkdir -m 755 -p /tmp/nginx/ ;\
|
|
|
|
chown -R ${WEBUSER}:${WEBUSER} /data/ ;\
|
|
|
|
mkdir -p /etc/nginx/sites-enabled ;\
|
|
|
|
ln -s /etc/nginx/sites-available/10_cache.conf /etc/nginx/sites-enabled/10_generic.conf; \
|
|
|
|
ln -s /etc/nginx/sites-available/20_upstream.conf /etc/nginx/sites-enabled/20_upstream.conf; \
|
2023-10-28 18:08:28 +00:00
|
|
|
ln -s /etc/nginx/sites-available/30_metrics.conf /etc/nginx/sites-enabled/30_metrics.conf; \
|
2022-11-12 12:10:20 +00:00
|
|
|
ln -s /etc/nginx/stream-available/10_sni.conf /etc/nginx/stream-enabled/10_sni.conf; \
|
|
|
|
mkdir -m 755 -p /data/cachedomains ;\
|
|
|
|
mkdir -m 755 -p /tmp/nginx
|
2018-11-28 22:35:06 +00:00
|
|
|
|
2020-02-28 08:05:56 +00:00
|
|
|
RUN git clone --depth=1 --no-single-branch https://github.com/uklans/cache-domains/ /data/cachedomains
|
2018-11-28 22:35:06 +00:00
|
|
|
|
|
|
|
VOLUME ["/data/logs", "/data/cache", "/data/cachedomains", "/var/www"]
|
|
|
|
|
2023-10-28 22:00:57 +00:00
|
|
|
EXPOSE 80 443 8080
|
2018-11-28 22:35:06 +00:00
|
|
|
WORKDIR /scripts
|