Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
2eaf0e6
Added restart: unless-stopped to bring containers up on reboot
Crabbey Feb 28, 2020
1f92a31
Merge pull request #9 from Crabbey/master
VibroAxe Mar 23, 2020
be1ee34
Clarify some settings. here be dragons etc.
Lepidopterist May 13, 2020
b5e7746
Merge pull request #14 from Lepidopterist/master
Lepidopterist May 25, 2020
88d67f2
Added TZ variable to .env file
Jorgen1040 Jul 31, 2020
8702288
Added TZ based on .env variable to docker-compose.yml
Jorgen1040 Jul 31, 2020
393a875
Add TCP binding for DNS
Crabbey Aug 24, 2020
a3c5942
Merge pull request #20 from Crabbey/tcp
GotenXiao Aug 24, 2020
17ab582
Merge branch 'master' into master
Jorgen1040 Sep 13, 2020
c360c87
Add TZ to README
Jorgen1040 Sep 19, 2020
ec27061
Switched to stream images
VibroAxe Sep 25, 2020
03382e5
update script now removes orphans
MathewBurnett Nov 13, 2020
f1b183b
Update docker-compose.yml
VibroAxe Nov 13, 2020
5ddce40
Merge pull request #22 from lancachenet/stream
VibroAxe Nov 13, 2020
0804140
Merge branch 'master' into master
Jorgen1040 Dec 12, 2020
0d48e54
Remove unnecessary variables
Jorgen1040 Jan 7, 2021
b85d46a
Merge pull request #18 from Jorgen1040/master
VibroAxe Jan 8, 2021
404b886
Create stale.yml
VibroAxe Jan 15, 2021
34afcf0
Update .env
VibroAxe Oct 9, 2021
a940302
Clarify CACHE_INDEX requirements
VibroAxe Mar 5, 2022
45bad4d
Update README.md to reflect CACHE_INDEX_SIZE changes
VibroAxe Mar 5, 2022
5c8925e
Fix spelling error
19wolf Mar 24, 2022
53af931
Merge pull request #27 from 19wolf/master
MathewBurnett May 8, 2022
6f2ea20
Create enable_autostart.sh
VibroAxe Jun 28, 2022
7a7d176
Added enable_autostart.sh
VibroAxe Jun 28, 2022
3aecf25
Switch to using YAML anchors
VibroAxe Jun 28, 2022
ea28260
Updated FAQ link to website
ewancolyer Jul 9, 2022
d96e213
Update README.md
ewancolyer Jul 9, 2022
92c4bfd
Merge pull request #29 from ewancolyer/master
VibroAxe Aug 13, 2022
97fc58b
Merge pull request #28 from lancachenet/VibroAxe-patch-1
VibroAxe Nov 12, 2022
5250f44
Changing CACHE_DISK_SIZE to use the 'g' suffix instead of 'm', as dis…
tpill90 Feb 16, 2023
4def819
Update README.md
tpill90 Feb 16, 2023
b074bc9
Merge pull request #34 from tpill90/master
VibroAxe Apr 24, 2023
a956dce
chore: update docker-compose.yml
Apr 9, 2024
661be07
Adding support for NGINX's min_free variable
tpill90 May 6, 2024
a1627fd
Fixed spelling to use the British spelling of words. Added a cspell …
tpill90 May 29, 2024
705695e
Removing "colour" that was accidentially inserted where it shouldn't …
tpill90 Jun 24, 2024
63e854f
Merge pull request #44 from tpill90/MinFreeSpace
VibroAxe Jul 8, 2024
12beb1f
Delete .github/stale.yml
tpill90 Feb 22, 2025
810b61d
Merge pull request #43 from Hannsre/update-compose
Lepidopterist Feb 23, 2025
fde72aa
Merge pull request #47 from tpill90/patch-1
Lepidopterist Feb 23, 2025
82791ea
Update update_containers.sh to use new docker compose variant
Lepidopterist Feb 23, 2025
3ced790
Merge pull request #48 from lancachenet/Lepidopterist-patch-1
Lepidopterist Feb 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .cspell.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// cSpell Settings
{
"version": "0.2",
"language": "en-GB",

"dictionaries": [
// Makes cSpell only use the British spelling of words
"!en_US"
],
// List of words to be always considered correct
"words": [
],
// List of words to be always considered incorrect
// This is useful for offensive words and common spelling errors.
// For example "hte" should be "the"
"flagWords": [
"hte"
]
}
31 changes: 21 additions & 10 deletions .env
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
## See the "Settings" section in README.md for more details

## Set this to true if you're using a load balancer, or set it to false if you're using seperate IPs for each service.
## Set this to true if you're using a load balancer, or set it to false if you're using separate IPs for each service.
## If you're using monolithic (the default), leave this set to true
USE_GENERIC_CACHE=true

## IP addresses that the lancache monolithic instance is reachable on
## Specify one or more IPs, space separated - these will be used when resolving DNS hostnames through lancachenet-dns. Multiple IPs can improve cache priming performance for some services (e.g. Steam)## IP Address that the lancache monolithic instance will run on
## Specify one or more IPs, space separated - these will be used when resolving DNS hostnames through lancachenet-dns. Multiple IPs can improve cache priming performance for some services (e.g. Steam)
## Note: This setting only affects DNS, monolithic and sniproxy will still bind to all IPs by default
LANCACHE_IP=10.0.39.1

Expand All @@ -19,14 +19,25 @@ UPSTREAM_DNS=8.8.8.8
## Note that by default, this will be a folder relative to the docker-compose.yml file
CACHE_ROOT=./lancache

## Change this to customise the size of the memory cache (default 500m)
CACHE_MEM_SIZE=500m

## Change this to customise the size of the disk cache (default 1000000m)
## If you have more storage, you'll likely want to increase this
## Change this to customise the maximum size of the disk cache (default 2000g).
## If you have more storage, you'll likely want to increase this.
## The cache server will prune content on a least-recently-used basis if it
## starts approaching this limit
CACHE_DISK_SIZE=1000000m
## starts approaching this limit.
CACHE_DISK_SIZE=2000g

## Sets the minimum free disk space that must be kept at all times.
## When the available free space drops below the set amount for any reason,
## the cache server will begin pruning content to free up space.
## Prevents accidentally running out of disk space if CACHE_DISK_SIZE is set too high.
MIN_FREE_DISK=10g

## Change this to allow sufficient index memory for the nginx cache manager (default 500m)
## We recommend 250m of index memory per 1TB of CACHE_DISK_SIZE
CACHE_INDEX_SIZE=500m

## Change this to limit the maximum age of cached content (default 3650d)
CACHE_MAX_AGE=3650d
CACHE_MAX_AGE=3650d

## Set the timezone for the docker containers, useful for correct timestamps on logs (default Europe/London)
## Formatted as tz database names. Example: Europe/Oslo or America/Los_Angeles
TZ=Europe/London
32 changes: 23 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

![Docker Pulls](https://img.shields.io/docker/pulls/lancachenet/monolithic?label=Monolithic) ![Docker Pulls](https://img.shields.io/docker/pulls/lancachenet/lancache-dns?label=Lancache-dns) ![Docker Pulls](https://img.shields.io/docker/pulls/lancachenet/sniproxy?label=Sniproxy) ![Docker Pulls](https://img.shields.io/docker/pulls/lancachenet/generic?label=Generic)

This docker-compose is meant as an example for running our lancache stack, It will run out of the box with minimal changes to the `.env` file for your local IP address.
This docker-compose is meant as an example for running our lancache stack, It will run out of the box with minimal changes to the `.env` file for your local IP address and disk settings.

Once (and only once) you have a working system run `sudo ./enable_autostart.sh` to allow the containers to run at system startup

# Settings
> You *MUST* set at least `LANCACHE_IP` and `DNS_BIND_IP`. It is highly recommended that you change `CACHE_ROOT` to a folder of your choosing, and set [`CACHE_DISK_SIZE`](#cache_disk_size) to a value that suits your storage capacity.
Expand Down Expand Up @@ -50,24 +52,36 @@ The `CACHE_ROOT` should either be on a separate partition, or ideally on separat

> **Note:** this setting defaults to `./lancache`. Unless your cache storage lives here, you probably want to change this value.

## `CACHE_MEM_SIZE`
This controls the size of the memory cache used by the cache server. The default should suffice for almost all configurations.
## `CACHE_DISK_SIZE`
This setting will constrain the upper limit of space used by cached data.
The cache server will automatically delete cached data when the total stored amount approaches this limit, in a least-recently-used fashion (oldest data, least accessed deleted first).

> **Note:** this setting does not limit the amount of memory that the Linux host will use for page caches, only what the cache server will use itself - see the Docker documentation on limiting memory consumption for a container if you wish to constrain the total memory consumption of the cache server, but generally you want as much memory as possible on your cache server to be used to store hot data.
> **Note:** that this must be given in either:
> - gigabytes, with `g` suffix (e.g. the default value, `2000g`)
> - terabytes, with `t` suffix (e.g. `4t`)

## `CACHE_DISK_SIZE`
This setting will constrain the upper limit of space used by cached data. You generally want to leave a small gap (10-20GB at least) between the size listed here and the available storage space used for the cached data, just in case.
## `MIN_FREE_DISK`
Configures the minimum amount of free disk space that must be kept at all times. This setting avoids the scenario where the disk can accidentally become completely full, and no further data can be written.

The cache server will automatically cached data when the total stored amount approaches this limit, in a least-recently-used fashion (oldest data, least accessed deleted first).
When the available free space drops below the set amount for any reason, the cache server will begin pruning content in a least-recently-used fashion, similar to how `CACHE_DISK_SIZE` works.

> **Note:** that this must be given in megabytes with an `m` suffix (e.g. the default value, `1000000m`).
## `CACHE_INDEX_SIZE`
Change this to allow sufficient index memory for the nginx cache manager (default 500m)
We recommend 250m of index memory per 1TB of CACHE_DISK_SIZE

> **Note:** this setting does not limit the amount of memory that the Linux host will use for page caches, only what the cache server will use itself - see the Docker documentation on limiting memory consumption for a container if you wish to constrain the total memory consumption of the cache server, but generally you want as much memory as possible on your cache server to be used to store hot data.

## `CACHE_MAX_AGE`
This setting allows you to control the maximum duration cached data will be kept for. The default should be fine for most use cases - the `CACHE_DISK_SIZE` setting will generally be used before this for aging out data.

> **Note:** this must be given as a number of days in age before expiry, with a `d` suffix (e.g. the default value, `3650d`).

## `TZ`
This setting allows you to set the timezone that is used by the docker containers. Most notably changing the timestamps of the logs. Useful for debugging without having to think sometimes multiple hours in the future/past.

For a list of all timezones see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones.

# More information
The LanCache docker-stack is generated automatically from the data over at [UKLans](https://github.com/uklans/cache-domains). All services that are listed in the UKLans repository are available and supported inside this docker-compose.

For an FAQ see https://github.com/lancachenet/monolithic/blob/master/faq.md
For an FAQ see https://lancache.net/docs/faq/
22 changes: 16 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
version: '2'
x-restart-policy: &restart-policy "no"
services:
dns:
image: lancachenet/lancache-dns:latest
env_file: .env
restart: *restart-policy
ports:
- ${DNS_BIND_IP}:53:53/udp
sniproxy:
image: lancachenet/sniproxy:latest
env_file: .env
ports:
- 443:443/tcp
- ${DNS_BIND_IP}:53:53/tcp

## HTTPS requests are now handled in monolithic directly
## you could choose to return to sniproxy if desired
#
# sniproxy:
# image: lancachenet/sniproxy:latest
# env_file: .env
# restart: *restart-policy
# ports:
# - 443:443/tcp

monolithic:
image: lancachenet/monolithic:latest
env_file: .env
restart: *restart-policy
ports:
- 80:80/tcp
- 443:443/tcp
volumes:
- ${CACHE_ROOT}/cache:/data/cache
- ${CACHE_ROOT}/logs:/data/logs
4 changes: 4 additions & 0 deletions enable_autostart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

sed -i 's/x-restart-policy: \&restart-policy "no"/x-restart-policy: \&restart-policy "unless-stopped"/g' docker-compose.yml
docker-compose up -d
4 changes: 2 additions & 2 deletions update_containers.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash


docker-compose pull
docker-compose up -d
docker compose pull
docker compose up -d --remove-orphans