commit a92ae575b921a42bf76a3296e6d22e38de937872 Author: Dave Pedu Date: Sun Apr 17 10:06:16 2016 -0700 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..84a0f56 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM ubuntu:trusty + +RUN useradd --uid 1000 mcserver && \ + apt-get update && \ + apt-get install -y openjdk-7-jre-headless supervisor && \ + mkdir -p /srv/spigot/ /srv/spigot-default/ && \ + chown -R mcserver:mcserver /srv/spigot/ + +ENV MEMLIMIT=1024m + +ADD copyjars.sh /usr/local/bin/ +ADD spigot-1.9.2.jar /srv/spigot-default/spigot.jar +ADD eula.txt /srv/spigot-default/ +ADD supervisor.conf /etc/supervisor/conf.d/ +ADD spigot.conf /etc/supervisor/conf.d/ + +ENTRYPOINT ["supervisord"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..675dc80 --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# docker-spigot + +**A setup for spigot within docker.** + +Currently minecraft 1.9.2. + +## Quick start + +* Clone: `git clone ssh://git@gitlab.davepedu.com:222/dave/docker-spigot.git` +* Build: `cd docker-nexus ; docker build -t spigot .` +* Run: `docker run nexus` + + +## Persistence + +Mount `/srv/spigot/` to the host. This dir should be owned by UID 1000: + +* `-v /host/path/data/:/srv/spigot/` + +## Protips + +* Memory limit: `-e MEMLIMIT=512m`. Defaults to 1024m. diff --git a/copyjars.sh b/copyjars.sh new file mode 100755 index 0000000..f568235 --- /dev/null +++ b/copyjars.sh @@ -0,0 +1,3 @@ +#!/bin/bash +test ! -f /srv/spigot/spigot.jar && mv /srv/spigot-default/spigot.jar /srv/spigot/ +test ! -f /srv/spigot/eula.txt && mv /srv/spigot-default/eula.txt /srv/spigot/ diff --git a/eula.txt b/eula.txt new file mode 100644 index 0000000..f7c5a7b --- /dev/null +++ b/eula.txt @@ -0,0 +1,3 @@ +#By changing the setting below to TRUE you are indicating your agreement to our EULA (https://account.mojang.com/documents/minecraft_eula). +#Sat Apr 16 19:36:40 PDT 2016 +eula=true diff --git a/spigot-1.9.2.jar b/spigot-1.9.2.jar new file mode 100644 index 0000000..2648ccb Binary files /dev/null and b/spigot-1.9.2.jar differ diff --git a/spigot.conf b/spigot.conf new file mode 100644 index 0000000..5d55570 --- /dev/null +++ b/spigot.conf @@ -0,0 +1,13 @@ +[program:copyjar] +command=/usr/local/bin/copyjars.sh +priority=1 +autorestart=false +startretries=0 + + +[program:spigot] +command=java -Xmx%(ENV_MEMLIMIT)s -jar spigot.jar --nojline +user=mcserver +priority=10 +redirect_stderr=true +directory=/srv/spigot/ diff --git a/supervisor.conf b/supervisor.conf new file mode 100644 index 0000000..54296b8 --- /dev/null +++ b/supervisor.conf @@ -0,0 +1,2 @@ +[supervisord] +nodaemon=true