[mc] Add PROXY env var option

For #177
This commit is contained in:
Geoff Bourne 2017-12-08 09:46:35 -06:00
parent b9787182e6
commit 3a64e32184
3 changed files with 30 additions and 0 deletions

View file

@ -732,3 +732,11 @@ In order to adapt to differences in `UID` and `GID` settings the entry script wi
General JVM options can be passed to the Minecraft Server invocation by passing a `JVM_OPTS`
environment variable. Options like `-X` that need to proceed general JVM options can be passed
via a `JVM_XX_OPTS` environment variable.
### HTTP Proxy
You may configure the use of an HTTP/HTTPS proxy by passing the proxy's URL via the `PROXY`
environment variable. In [the example compose file](docker-compose-proxied.yml) it references
a companion squid proxy by setting the equivalent of
-e PROXY=proxy:3128

View file

@ -0,0 +1,15 @@
version: '3'
services:
mc:
build: .
ports:
- 25565:25565
environment:
EULA: "TRUE"
# TYPE: SPIGOT
# VERSION: 1.11.2
PROXY: proxy:3128
proxy:
image: sameersbn/squid

View file

@ -29,6 +29,13 @@ if ! touch /data/.verify_access; then
exit 2
fi
if [[ $PROXY ]]; then
export http_proxy="$PROXY"
export https_proxy="$PROXY"
echo "INFO: Giving proxy time to startup..."
sleep 5
fi
export SERVER_PROPERTIES=/data/server.properties
export FTB_DIR=/data/FeedTheBeast
export VERSIONS_JSON=https://launchermeta.mojang.com/mc/game/version_manifest.json