├── Dockerfile ├── README.md └── entrypoint.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm-slim 2 | 3 | RUN export DEBIAN_FRONTEND noninteractive && \ 4 | apt-get update && \ 5 | apt-get install -y --no-install-recommends --no-install-suggests net-tools tar unzip curl xvfb locales ca-certificates lib32gcc-s1 wine64 && \ 6 | echo en_US.UTF-8 UTF-8 >> /etc/locale.gen && locale-gen && \ 7 | rm -rf /var/lib/apt/lists/* 8 | RUN ln -s '/home/user/Steam/steamapps/common/Empyrion - Dedicated Server/' /server && \ 9 | mkdir /tmp/.X11-unix && chmod 1777 /tmp/.X11-unix && \ 10 | useradd -m user 11 | 12 | USER user 13 | ENV HOME /home/user 14 | WORKDIR /home/user 15 | 16 | RUN curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz" | tar xz 17 | # Get's killed at the end 18 | RUN ./steamcmd.sh +login anonymous +quit || : 19 | 20 | EXPOSE 30000/udp 21 | ADD entrypoint.sh / 22 | ENTRYPOINT ["/entrypoint.sh"] 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # empyrion-server 2 | **Docker image for the [Empyrion](https://empyriongame.com/) dedicated server using WINE** 3 | 4 | This Docker image includes WINE and steamcmd, along with an entrypoint script that bootstraps the Empyrion dedicated server installation via steamcmd. 5 | 6 | ## Breaking changes 7 | The entrypoint no longer `chown`'s the Steam directory, so make sure to run the container as a user with appropriate permissions. 8 | 9 | ## Usage 10 | 11 | ### Basic setup 12 | 1. Create a directory for your game data: 13 | ```sh 14 | mkdir -p gamedir 15 | ``` 16 | 2. Run the Docker container: 17 | ```sh 18 | docker run -d -p 30000:30000/udp --restart unless-stopped -v $PWD/gamedir:/home/user/Steam bitr/empyrion-server 19 | ``` 20 | 21 | ### Running the experimental version 22 | 1. Create a directory for your beta game data: 23 | ```sh 24 | mkdir -p gamedir_beta 25 | ``` 26 | 2. Run the Docker container with the `BETA` environment variable set to 1: 27 | ```sh 28 | docker run -di -p 30000:30000/udp --restart unless-stopped -v $PWD/gamedir_beta:/home/user/Steam -e BETA=1 bitr/empyrion-server 29 | ``` 30 | 31 | ## Permission errors 32 | If you're getting permission errors, it's because the folder you mounted in with `-v` didn't already exist and is now created and owned by **root:root**. You need to `chown` the volume mount to **1000:1000** (unless you've specified otherwise when you ran the `docker` command) 33 | 34 | ## Configuration 35 | After starting the server, you can edit the **dedicated.yaml** file located at **gamedir/steamapps/common/Empyrion - Dedicated Server/dedicated.yaml**. You will need to restart the Docker container after making changes. 36 | 37 | The **DedicatedServer** folder is symlinked to **/server**, allowing you to refer to saves with **z:/server/Saves**. For example, for a save called **The_Game**: 38 | ```sh 39 | # Run the container with the specific save 40 | docker run -d -p 30000:30000/udp --restart unless-stopped -v $PWD/gamedir:/home/user/Steam bitr/empyrion-server -- -dedicated 'z:/server/Saves/Games/The_Game/dedicated.yaml' 41 | ``` 42 | 43 | ## Advanced Usage 44 | To append arguments to the `steamcmd` command, use the `STEAMCMD` environment variable. For example: 45 | ```sh 46 | -e "STEAMCMD=+runscript /home/user/Steam/add_scenario.txt" 47 | ``` 48 | 49 | So to add a scenario, you'd add the following to `$PWD/gamedir/add_scenario.txt`: 50 | 51 | ``` 52 | workshop_download_item 383120 53 | ``` 54 | 55 | Look for multiplayer scenarios at https://steamcommunity.com/workshop/browse?appid=383120 and use the workshop id (available in the browser url when configuring which scenario to add) 56 | 57 | ## Additional Information 58 | For more information about setting up the Empyrion dedicated server, refer to the [wiki](https://empyrion.gamepedia.com/Dedicated_Server_Setup). 59 | 60 | -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | GAMEDIR="$HOME/Steam/steamapps/common/Empyrion - Dedicated Server/DedicatedServer" 4 | 5 | : ${STEAMCMD} 6 | BETACMD= 7 | [ -z "$BETA" ] || BETACMD="-beta experimental" 8 | 9 | ./steamcmd.sh +@sSteamCmdForcePlatformType windows +login anonymous +app_update 530870 $BETACMD $STEAMCMD +quit 10 | 11 | mkdir -p "$GAMEDIR/Logs" 12 | 13 | rm -f /tmp/.X1-lock 14 | Xvfb :1 -screen 0 800x600x24 & 15 | export WINEDLLOVERRIDES="mscoree,mshtml=" 16 | export DISPLAY=:1 17 | 18 | cd "$GAMEDIR" 19 | 20 | [ "$1" = "bash" ] && exec "$@" 21 | 22 | sh -c 'until [ "`netstat -ntl | tail -n+3`" ]; do sleep 1; done 23 | sleep 5 # gotta wait for it to open a logfile 24 | tail -F Logs/current.log ../Logs/*/*.log 2>/dev/null' & 25 | /usr/lib/wine/wine64 ./EmpyrionDedicated.exe -batchmode -nographics -logFile Logs/current.log "$@" &> Logs/wine.log 26 | --------------------------------------------------------------------------------