From cdb02751b6210847c97dc5b1a87ad9a4d7a2bfd7 Mon Sep 17 00:00:00 2001 From: Trey Yoder Date: Sun, 19 Apr 2020 16:51:00 -0400 Subject: [PATCH] Initial push --- Dockerfile | 5 +++++ README.md | 23 +++++++++++++++++++++++ entrypoint.sh | 14 ++++++++++++++ prebuild/Dockerfile | 18 ++++++++++++++++++ prebuild/README.md | 5 +++++ 5 files changed, 65 insertions(+) create mode 100644 Dockerfile create mode 100644 README.md create mode 100644 entrypoint.sh create mode 100644 prebuild/Dockerfile create mode 100644 prebuild/README.md diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ce642df --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM treyyoder/quakejs:latest + +ADD entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..529d658 --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +A fully local and Dockerized server of quakejs. +----- + +The purpose of this project was to create a fully independent quakejs server that doesn't need any content served from the internet. +Hence, once pulled, this does not need to connect to any external provider, ie. content.quakejs.com. Nor does this server need to be proxied/served/relayed from http://www.quakejs.com/ + +Simply pull the image [treyyoder/quakejs](https://hub.docker.com/r/treyyoder/quakejs) and run it: + +``` +docker run -d --name quakejs -e SERVER= -e HTTP_PORT= -p :80 -p 27960:27960 treyyoder/quakejs:latest +``` + +Example: + +``` +docker run -d --name quakejs -e SERVER=10.0.0.2 -e HTTP_PORT=8080 -p 8080:80 -p 27960:27960 treyyoder/quakejs:latest +``` + +Send all you friends/coworkers the link: ex. http://10.0.0.2:8080 and happy fragging ;) + +Credits: + +Thanks to @begleysm with [his fork](https://github.com/begleysm/quakejs) of [quakejs](https://github.com/inolen/quakejs) and [documentation](https://steamforge.net/wiki/index.php/How_to_setup_a_local_QuakeJS_server_under_Debian_9_or_Debian_10) diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..2f4919a --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,14 @@ +#!/bin/sh +echo '127.0.0.1 content.quakejs.com' >> /etc/hosts + +cd /var/www/html + +sed -i "s/10.0.0.2/${SERVER}/g" index.html + +sed -i "s/8085/${HTTP_PORT}/g" index.html + +/etc/init.d/apache2 start + +cd /quakejs + +node build/ioq3ded.js +set fs_game baseq3 set dedicated 1 +exec server.cfg diff --git a/prebuild/Dockerfile b/prebuild/Dockerfile new file mode 100644 index 0000000..b2ccf02 --- /dev/null +++ b/prebuild/Dockerfile @@ -0,0 +1,18 @@ +FROM ubuntu:latest + +RUN apt update +RUN apt upgrade -y + +RUN apt-get install sudo curl git nodejs npm -y + +RUN curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash - + +#RUN adduser quake +#RUN usermod -aG sudo quake +#USER quake + +RUN git clone --recurse-submodules https://github.com/begleysm/quakejs.git +WORKDIR /quakejs + +RUN npm install +RUN node build/ioq3ded.js +set fs_game baseq3 +set dedicated 1 diff --git a/prebuild/README.md b/prebuild/README.md new file mode 100644 index 0000000..3bc1b03 --- /dev/null +++ b/prebuild/README.md @@ -0,0 +1,5 @@ +This will get you started on the build, but I didn't have time to figure out a way to accept the agreement automagically, so I finished the rest of the steps manually. + +You could run some of the later steps such as setting up apache2 before initializing the quakejs server to automate this a bit more. + +Once you have everything running commit the container and use that as the base image in the main Dockerfile