diff options
| author | Dark1-dev <shansarkar272@gmail.com> | 2023-03-01 21:28:57 +0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-01 21:28:57 +0600 |
| commit | c784240d1af68dbd8d0466822b34fd05d6ccdda1 (patch) | |
| tree | 5446821b895c8290d1a366b902f1411dfca9733e /README.docker.md | |
| download | Masterserver-Qt5-c784240d1af68dbd8d0466822b34fd05d6ccdda1.tar.gz Masterserver-Qt5-c784240d1af68dbd8d0466822b34fd05d6ccdda1.zip | |
Add files via upload
Initialize repository
Diffstat (limited to 'README.docker.md')
| -rw-r--r-- | README.docker.md | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/README.docker.md b/README.docker.md new file mode 100644 index 0000000..a47a20e --- /dev/null +++ b/README.docker.md @@ -0,0 +1,47 @@ +# Building and Running MasterServer in Docker + +Running the MasterServer in Docker may be useful on systems which don't have +appropriate build or runtime environments available to run the service +natively. + +## Build + +From the project root directory, run: + +```sh +docker build -t 333masterserver:latest . +``` + +This will compile the source and build a Docker image named `333masterserver`, +tagged as `latest`. + +## Setup + +To maintain the database and configuration outside the Docker container +runtime, create some directories on the host to hold these files. + +1. Create data directory: + - note: I recommend creating this in a separate location, such as + `/var/lib/masterserver` + 1. `/var/lib/masterserver/data` + 2. Assign ownership to UID 1 (this is the non-root UID the process will run + as): `chown -R 1 /var/lib/masterserver` +2. Create configuration file in + `/var/lib/masterserver/data/MasterServer-Settings.ini` + - Follow configuration instructions in [README.md](README.md) to populate + the configuration file appropriately. +3. Copy file `SupportedGames.json` to `/var/lib/masterserver/data/` + +## Run + +After directories and configuration have been created, run the service as a +non-interactive daemon process: + +```sh +docker run --restart always --name masterserver -d \ + -v /var/lib/masterserver/data:/masterserver/data \ + -v masterserver-log:/masterserver/log \ + -p 27900:27900/udp \ + -p 28900:28900/tcp \ + 333masterserver:latest +``` |
