Skip to content

Commit

Permalink
Rebase generic off monolithic
Browse files Browse the repository at this point in the history
-----DO NOT MERGE UNTIL UPDATING DOCKERFILE TO LATEST------

This commit rebases the generic code off the monolithic image
This allows the base image to be the more regularly accessed / edited image
removing the minor map changes directly in this generic image

Commits to lancachenet/monolithic:switcheroo will mimic this commit

Also fixes #108
  • Loading branch information
VibroAxe committed Jul 20, 2021
1 parent 9ca9b24 commit 02cffb6
Show file tree
Hide file tree
Showing 24 changed files with 32 additions and 255 deletions.
21 changes: 5 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM lancachenet/ubuntu-nginx:latest
MAINTAINER LanCache.Net Team <[email protected]>
FROM lancachenet/monolithic:switcheroo
LABEL version=3
LABEL description="Single agressive caching container for caching game content at lan parties."
LABEL maintainer=" LanCache.Net Team <[email protected]>"

ENV GENERICCACHE_VERSION=2 \
WEBUSER=www-data \
CACHE_MODE=generic \
CACHE_MEM_SIZE=500m \
CACHE_DISK_SIZE=1000000m \
Expand All @@ -15,19 +16,7 @@ ENV GENERICCACHE_VERSION=2 \

COPY overlay/ /

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} ;\
chmod 755 /scripts/* ;\
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_generic.conf /etc/nginx/sites-enabled/10_generic.conf; \
ln -s /etc/nginx/stream-available/10_sni.conf /etc/nginx/stream-enabled/10_sni.conf
RUN rm -rf /data/cachedomains/*

VOLUME ["/data/logs", "/data/cache", "/var/www"]

Expand Down
2 changes: 1 addition & 1 deletion goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ command:
exit-status: 0
stdout:
- Succesfully Cached
timeout: 10000
timeout: 20000
process:
nginx:
running: true
Expand Down
1 change: 0 additions & 1 deletion overlay/etc/nginx/conf.d/20_proxy_cache_path.conf

This file was deleted.

1 change: 1 addition & 0 deletions overlay/etc/nginx/conf.d/30_maps.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#no maps needed in generic
39 changes: 0 additions & 39 deletions overlay/etc/nginx/nginx.conf

This file was deleted.

10 changes: 0 additions & 10 deletions overlay/etc/nginx/sites-available/10_generic.conf

This file was deleted.

19 changes: 0 additions & 19 deletions overlay/etc/nginx/sites-available/generic.conf.d/10_generic.conf

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

9 changes: 0 additions & 9 deletions overlay/etc/nginx/stream-available/10_sni.conf

This file was deleted.

1 change: 0 additions & 1 deletion overlay/etc/nginx/workers.conf

This file was deleted.

4 changes: 0 additions & 4 deletions overlay/etc/supervisor/conf.d/heartbeat.conf

This file was deleted.

46 changes: 0 additions & 46 deletions overlay/hooks/entrypoint-pre.d/05_config_check.sh

This file was deleted.

14 changes: 0 additions & 14 deletions overlay/hooks/entrypoint-pre.d/10_setup.sh

This file was deleted.

3 changes: 3 additions & 0 deletions overlay/hooks/entrypoint-pre.d/15_generate_maps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

# no maps needed
14 changes: 0 additions & 14 deletions overlay/hooks/entrypoint-pre.d/20_perms_check.sh

This file was deleted.

9 changes: 0 additions & 9 deletions overlay/hooks/supervisord-pre.d/99_config_check.sh

This file was deleted.

28 changes: 22 additions & 6 deletions overlay/scripts/cache_test.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
#!/bin/bash
set -e
pageload1=`curl http://www.lagado.com/tools/cache-test --resolve www.lagado.com:80:127.0.0.1`
pageload1=`curl http://www.worldtimeapi.org/api/timezone/ETC/GMT --resolve www.worldtimeapi.org:80:127.0.0.1`
sleep 5
pageload2=`curl http://www.lagado.com/tools/cache-test --resolve www.lagado.com:80:127.0.0.1`

pageload2=`curl http://www.worldtimeapi.org/api/timezone/ETC/GMT --resolve www.worldtimeapi.org:80:127.0.0.1`
sleep 5
pageload3=`curl http://worldtimeapi.org/api/timezone/ETC/GMT --resolve worldtimeapi.org:80:127.0.0.1`
sleep 5
pageload4=`curl http://worldtimeapi.org/api/timezone/ETC/GMT --resolve worldtimeapi.org:80:127.0.0.1`
if [ "$pageload1" == "$pageload2" ]; then
echo "Succesfully Cached"
exit 0
if [ "$pageload3" == "$pageload4" ]; then
if [ "$pageload1" == "$pageload4" ]; then
echo "Succesfully Cached"
exit 0
else
#In generic pages 1+4 should be identical as all domains are cached equally
echo "Error caching test page, pages 1+4 are different"
exit -3
fi

else
echo "Error caching test page, pages 3+4 different"
exit -2
fi

else
echo "Error caching test page, pages differed"
echo "Error caching test page, pages 1+2 different"
exit -1
fi

0 comments on commit 02cffb6

Please sign in to comment.