Skip to content

longjunyu2/TheForest-DedicatedServer-Docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TheForest-DedicatedServer-Docker

Build

Build base image. There's only server files in this image.

cd base
docker build -t <base_image_name> .

Then build final image. There's a startup shell script to start the server.

cd server
docker build -t <final_image_name> .

The default <base_image_name> is longjunyu/theforest-base.
If you want to use another name, don't forget to change to first line of server/Dockerfile to the one you set. FROM <base_image_name_you_set>

Run

Before creating the container, you need create a file for config and a folder for saves.
Here is a tutorial about how to creating the config file. Dedicated Server Tutorial

docker cli

docker run -d \
    --name=<container_name> \
    --net=host \
    -v <path_to_config>:/data/config/config.cfg \
    -v <path_to_saves>:/data/config/saves \
    <final_image_name>

There's some issues with bridge network mode. You will meet DS configurations tests: failed and the server WON'T startup

docker run -d \
    --name=<container_name> \
    --net=bridge \
    -p 8766:8766/udp \
    -p 27015:27015/udp \
    -p 27016:27016/udp \
    -v <path_to_config>:/data/config/config.cfg \
    -v <path_to_saves>:/data/config/saves \
    <final_image_name>

Other Parameters

There are also some additional parameters that can be set to the container.

Parameter Function
-e USER_ID=1000 for UserID - see below for explanation
-e GROUP_ID=1000 for GroupID - see below for explanation
-e TZ=Asia/Shanghai specify a timezone to use, see this list.

User / Group Identifiers

When using volumes (-v flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user PUID and group PGID.
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish.
In this instance USER_ID=1000 and GROUP_ID=1000, to find yours use id your_user as below:
id <your_user>
Example output:
uid=1000(your_user) gid=1000(your_user) groups=1000(your_user)

Pull From DockerHub

docker pull longjunyu/theforest-server

About

The Dockerfile for The forest dedicated server

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published