diff options
| author | darkelarious <darkelarious@code.333networks.com> | 2022-12-27 13:46:33 +0000 |
|---|---|---|
| committer | darkelarious <darkelarious@code.333networks.com> | 2022-12-27 13:46:33 +0000 |
| commit | b58c8756bd4c3c6e4414e5b5ba09b00fa086ea68 (patch) | |
| tree | d44cadc8a7466603ca4c2706bcac78f89b1efc76 /README.docker.md | |
| parent | 5599174dd2fe862bb1b8875cd6ca1b659f74eab6 (diff) | |
| parent | c3f5a41531a8350e3279c998d074df56f9980c9b (diff) | |
| download | WebInterface-Perl-b58c8756bd4c3c6e4414e5b5ba09b00fa086ea68.tar.gz WebInterface-Perl-b58c8756bd4c3c6e4414e5b5ba09b00fa086ea68.zip | |
Merge pull request 'Add Docker support' (#2) from shrimp/WebInterface-Perl-MS-Qt5:docker-support into master
Diffstat (limited to 'README.docker.md')
| -rw-r--r-- | README.docker.md | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/README.docker.md b/README.docker.md new file mode 100644 index 0000000..ae5426b --- /dev/null +++ b/README.docker.md @@ -0,0 +1,62 @@ +# Building and Running MasterServer Web UI in Docker + +Running the MasterServer Web UI in Docker may be useful on systems which don't +have appropriate runtime environments available to run the web interface +natively. + +## Build + +From the project root directory, run: + +```sh +docker build -t 333masterserver-ui:latest . +``` + +This will build a Docker image containing all the required dependencies and +configuration, named `333masterserver-ui`, tagged as `latest`. + +## Setup + +As with the stand-alone configuration described in [README.md](README.md), you +need to also be running the MasterServer itself, since the Web UI shares access +to the database. + +Importantly, the database must be readable _and writable_ by UID `1` (`daemon`) +if the IP to Country lookup us used for displaying flags in the UI. + +The only other setup required is to customise `settings.pl` as desired. + +Specifically, `db_login` must be customised as follows: + +```perl +db_login => ["dbi:SQLite:dbname=/masterserver/data/masterserver.db",'',''] +``` + +## Run + +Once the image is build and configuration is in place, you can run the Web UI +as follows. + +Note that the service listens on port `8080` internally, any host port can then +be forwarded to this to expose it externally. + +```sh +docker run --restart always --name masterserver-ui -d + -v /path/to/masterserver.db:/masterserver/data/masterserver.db + -v /path/to/settings.pl:/masterserver/data/settings.pl:ro + -p 8900:8080/tcp + 333masterserver-ui:latest +``` + +NOTE: If to disable the IP to Country lookup, pass set the `NO_IP_TO_COUNTRY` +environment variable, which also allows read-only mounting of the database +file, for example: + +```sh +docker run --restart always --name masterserver-ui -d + -v /path/to/masterserver.db:/masterserver/data/masterserver.db:ro + -v /path/to/settings.pl:/masterserver/data/settings.pl:ro + -p 8900:8080/tcp + -e NO_IP_TO_COUNTRY=1 + 333masterserver-ui:latest +``` |
