Sign inSign up

nextek/openttd

By nextek

Updated over 2 years ago

Alpine based OpenTTD server. Optimized for smallest size

Image
0

4.3K

nextek/openttd repository overview

Docker Build Latest Platform Tests

dockeri.co

An Alpine based image of bateau/openttd's docker.

Usage

Environment variables

These environment variables can be altered to change the behavior of the application inside the container.
To set a new value to an enviroment variable use docker's -e parameter (see https://docs.docker.com/engine/reference/commandline/run/ for more details)

EnvDefaultMeaning
savepath"/home/openttd"The path to which autosave wil save
loadgamenullload game has 4 settings. false, true, last-autosave and exit.
- false: this will just start server and create a new game.
- true: if true is set you also need to set savename. savename needs to be the name of the saved game file. This will load the given saved game.
- last-autosave: This will load the last autosaved game located in <$savepath>/autosave folder.
- exit: This will load the exit.sav file located in <$savepath>/autosave/.
savenamenullSet this when allong with loadgame=true to the value of your save game file-name
PUID"911"This is the ID of the user inside the container. If you mount in (-v </path/of/your/choosing>:</path/inside/container>) you would need for the user inside the container to have the same ID as your user outside (so that you can save files for example).
PGID"911"Same thing here, except Group ID. Your user has a group, and it needs to map to the same ID inside the container.
debugnullSet debug things. see openttd for debug options
Networking

By default docker does not expose the containers on your network. This must be done manually with -p parameter (see here for more details on -p). If your openttd config is set up to listen on port 3979 you need to map the container port to your machines network like so -p 3979:3979 where the first reference is the host machines port and the second the container port.

Examples
docker run
docker run --name OpenTTD_Server -d \
    -p 3979:3979/tcp \
    -p 3979:3979/udp \
    -e PUID=1000  \
    -e PGID=1000 \
    -e "loadgame=last-autosave" \
    -v /path/to/your/.openttd:/home/openttd/.openttd \
    --restart=unless-stopped \
    nextek/openttd:latest
Docker Compose
version: "3"
services:
  OpenTTD_Server:
    image: nextek/openttd:latest
    restart: unless-stopped
    ports:
      - 3979:3979/udp
      - 3979:3979/tcp
    environment:
      - loadgame=last-autosave
      - PUID=1000
      - PGID=1000
    volumes:
      - /path/to/your/.openttd:/home/openttd/.openttd

Kubernetes

Supplied some example for deploying on kubernetes cluster. "k8s_openttd.yml" just run

kubectl apply openttd.yaml

and it will apply configmap with openttd.cfg, deployment and service listening on port 31979 UDP/TCP.

Tag summary

Content type

Image

Digest

sha256:7b078a88c

Size

25.2 MB

Last updated

over 2 years ago

docker pull nextek/openttd