Stefan1200's Forum

English => JTS3ServerMod Projects and Scripts from other people => Topic started by: UncleSam on October 17, 2023, 08:59:23 PM

Title: Docker
Post by: UncleSam on October 17, 2023, 08:59:23 PM
Hi,


I have no real experience in running jts3servermod using docker, but I found a ways for me which seems to work fine. Feel free to try it. Of course this is NOT official - so use at your own risk.


Regarding the license system I have no clue at the moment if this is working as expected or not. Basically it has the same ip address but could have different hardware specs every time you delete the container and respawn it again.

I am not using a special docker container which contains the hosting files. Instead I am using the official openjdk image and just mount the bot-files inside. The benefit is also that this is not exposing any hosted files.


Requirements:

How To:
Also make sure to update the binding and telnet whitelist.


After performin this steps start the container using "docker compose" and check if it fails for something.


docker-compose.yaml
version: '3.5'
services:
        jts3servermod:
                container_name: jts3servermod
                image: openjdk:22
                volumes:
                        - ./botfiles:/botfiles
                restart: unless-stopped
                environment:
                        TZ: Europe/Berlin
                entrypoint: ["/botfiles/entrypoint.sh"]



entrypoint.sh
#!/bin/sh
cd /botfiles


# delete pid and lock file which could lead into the bot not starting
rm -f /botfiles/config/jts3servermod.pid
rm -f /botfiles/config/JTS3ServerMod_InstanceManager.cfg.lock


# run the bot
/usr/bin/java -Xms1G -Xmx2G -jar JTS3ServerMod.jar