• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!

What is the purpose of the Dockerfile?

Borsato

New Member
Joined
Jan 13, 2026
Messages
4
Reaction score
0
GitHub
FemenSB
I'm just starting out with OT development and I tried setting up TFS 1.5 using docker. I faced some difficulties in doing so and it seems like the Docker container won't actually work out of the box. For example, the server expects to know its IP from the config.lua or a runtime arg, which seems hard to properly configure inside a container given that we don't know the container's IP beforehand. Eventually I even found a comment from Nekiro advising not to use Docker to host TFS.
This leads me to the question: do people really use docker when hosting OT servers? If not, why is a Dockerfile distributed with the TFS repository?
Thanks in advance!
 
I think you are mistaking config.lua and dockerfile.
Docker file is not used to set settings for your server. It tells the machine what server needs to run. As far as i remember you set ip to 0.0.0.0 if you run dockerized tfs build
 
I think you are mistaking config.lua and dockerfile.
Docker file is not used to set settings for your server. It tells the machine what server needs to run. As far as i remember you set ip to 0.0.0.0 if you run dockerized tfs build
I tried setting 0.0.0.0 and it didn't work :S
Guess I'll just ditch the idea of using Docker, but it seems weird to me that so far I have encountered many reasons not to use it, but still the official repo contains a dockerfile
 
I tried setting 0.0.0.0 and it didn't work :S
Guess I'll just ditch the idea of using Docker, but it seems weird to me that so far I have encountered many reasons not to use it, but still the official repo contains a dockerfile
And you tried to connect via IP of domain that is used on docker not that 0.0.0.0?
 
do people really use docker when hosting OT servers?
I don't know anyone who use Docker to run OTS on production. OTS app has shutdown processes that can be very easily closed wrong by Docker process management and result in data (players progress/house items) loss - I run TVP server in Docker on Windows and it often lose houses data during shutdown.
If you are not experienced with Docker, I do not recommend to even try to run OTS in Docker on production.

If not, why is a Dockerfile distributed with the TFS repository?
Docker in TFS repo has 3 purposes:

Problem with TFS forks (ex. Nekiro 1.5) is that they copied old Dockerfile, which does not work after 1-2 years.
Ex. Nekiro 1.5 for 8.6 uses some Linux Alpine edge/testing, which was compatible with TFS 5 years ago (date of fork), but nowdays edge/testing points to much newer C++ libraries and probably won't work anymore:

Here is my setup for TFS 1.4 dev env - to run it on Windows in Docker with database hosted on Windows and OTS on Linux in Docker container: Windows - Linux Running on Windows (https://otland.net/threads/linux-running-on-windows.274039/#post-2697015)

I even made setup to compile and run OTClient in Docker on Windows and share Linux window with Windows (super slow): Windows - Linux Running on Windows (https://otland.net/threads/linux-running-on-windows.274039/#post-2754292)
 
And you tried to connect via IP of domain that is used on docker not that 0.0.0.0?
I set the client to connect to the IP of the container (running locally). I could reach the character selection screen, but after selecting the character it wouldn't connect to the server.
I don't know anyone who use Docker to run OTS on production. OTS app has shutdown processes that can be very easily closed wrong by Docker process management and result in data (players progress/house items) loss - I run TVP server in Docker on Windows and it often lose houses data during shutdown.
If you are not experienced with Docker, I do not recommend to even try to run OTS in Docker on production.


Docker in TFS repo has 3 purposes:

Problem with TFS forks (ex. Nekiro 1.5) is that they copied old Dockerfile, which does not work after 1-2 years.
Ex. Nekiro 1.5 for 8.6 uses some Linux Alpine edge/testing, which was compatible with TFS 5 years ago (date of fork), but nowdays edge/testing points to much newer C++ libraries and probably won't work anymore:

Here is my setup for TFS 1.4 dev env - to run it on Windows in Docker with database hosted on Windows and OTS on Linux in Docker container: Windows - Linux Running on Windows (https://otland.net/threads/linux-running-on-windows.274039/#post-2697015)

I even made setup to compile and run OTClient in Docker on Windows and share Linux window with Windows (super slow): Windows - Linux Running on Windows (https://otland.net/threads/linux-running-on-windows.274039/#post-2754292)
I see, it makes more sense now. Thank you for taking the time to explain it!
 
I set the client to connect to the IP of the container (running locally). I could reach the character selection screen, but after selecting the character it wouldn't connect to the server.
I think that OTS/TFS is not developed for this kind of Docker containers. It will probably return wrong IP of server, when you visit characters list (character lists contains IP of server and port, to which client connects, when you select character - it can be other IP than in config.lua, there is some 'source IP' logic to find valid IP for connecting client).

You would need to use 'host network' in Docker and in OTS config.lua set IP to public IP of VPS/dedic ( Host network driver (https://docs.docker.com/engine/network/drivers/host/) ).
This is possible only when Docker is running Linux container on Linux. This kind of network configuration is not possible on Windows.
 
We actually run our entire OTS stack in Docker — not just TFS, but everything:
  • TFS
  • PHP-FPM
  • NGINX
  • Redis
  • MySQL
  • phpMyAdmin
  • Cam Player
And for us, Docker has several major advantages:
Easy migration & portability
If we need to move to a new dedicated server, we don’t reinstall anything manually. We use Ansible to setup everything for us.
We just install Docker + download docker images and run them.
The whole stack comes up exactly the same as before. No “works on my machine” issues.

Isolation between services
Each service runs in its own container:
  • TFS doesn’t interfere with PHP
  • PHP doesn’t interfere with MySQL
  • Redis is isolated
  • No shared system libraries breaking other apps
No dependency conflicts. No system pollution.

Controlled library versions
We can pin:
specific GCC / Boost versions for TFS
exact MySQL version
exact PHP version
If we update the host OS, nothing breaks — because the containers keep their own environment.

Safer experimentation
With Docker you can:
test new PHP versions
test new TFS updates
Without touching production — just spin up another container.

If someone wants to get started I recommend this tutorial: https://www.udemy.com/course/learn-docker/
 
We actually run our entire OTS stack in Docker — not just TFS, but everything:
  • TFS
  • PHP-FPM
  • NGINX
  • Redis
  • MySQL
  • phpMyAdmin
  • Cam Player
And for us, Docker has several major advantages:
Easy migration & portability
If we need to move to a new dedicated server, we don’t reinstall anything manually. We use Ansible to setup everything for us.
We just install Docker + download docker images and run them.
The whole stack comes up exactly the same as before. No “works on my machine” issues.

Isolation between services
Each service runs in its own container:
  • TFS doesn’t interfere with PHP
  • PHP doesn’t interfere with MySQL
  • Redis is isolated
  • No shared system libraries breaking other apps
No dependency conflicts. No system pollution.

Controlled library versions
We can pin:
specific GCC / Boost versions for TFS
exact MySQL version
exact PHP version
If we update the host OS, nothing breaks — because the containers keep their own environment.

Safer experimentation
With Docker you can:
test new PHP versions
test new TFS updates
Without touching production — just spin up another container.

If someone wants to get started I recommend this tutorial: https://www.udemy.com/course/learn-docker/
You gotta move volumes though. I do use docker for website, but never tried for tfs. Isn't it troublesome to debug coredumps? Doesn't it impact performance? It's another layer after all.
 
You gotta move volumes though. I do use docker for website, but never tried for tfs. Isn't it troublesome to debug coredumps? Doesn't it impact performance? It's another layer after all.
Yes, you’re absolutely right — you need to handle volumes properly.
In our case we mostly use bind mounts, not Docker-managed volumes.
So we mount host directories directly into containers for:
  • MySQL data directory
  • TFS data/ and config.lua
  • Website files
So moving data is no different than on a classic setup — it’s just normal filesystem data on the host.
I agree that Docker volumes on a single-node setup don’t give huge benefits.
They shine more in Kubernetes / multi-node environments where you need storage abstraction and migration between nodes.

There is basically no performance impact.
A Docker container is just a native process running on the host using Linux namespaces and cgroups — it’s not a VM. No hypervisor, no hardware emulation.
CPU and memory performance are native.
The only place you could potentially see overhead is:
  • bridge networking (can be avoided with network_mode: host)
  • overlay filesystem (minimal impact in real-world TFS usage)
In practice, we’ve never seen measurable degradation compared to bare metal.


Yes — it needs a few tweaks to make gdb work properly inside a container, mainly because of ptrace and Docker’s default seccomp profile.
Code:
docker run --rm -ti \
-u $(id -u ${USER}):$(id -g ${USER}) \
--cap-add=SYS_PTRACE \
--security-opt seccomp=unconfined \
--net host \
-v `pwd`:/server \
-v /etc/timezone:/etc/timezone \
-v /etc/localtime:/etc/localtime \
-v /var/run/mysqld:/var/run/mysqld \
--name gunzodus-server gunzot/engine-bookworm /bin/bash
 
I'm running Docker as a dev environment (one click to deploy everything, it starts with my ots laptop). It's pretty nice to have everything hooked with a single run button.
HOEVER. I've noticed that my client is randomly disconnecting from the game server without any error. Simply, it's dropping a ping packet every 30s -2 mintues
 
Back
Top