├── .dockerignore ├── .gitignore ├── Dockerfile ├── docker-compose.yml.example ├── .github └── workflows │ └── build-container.yml ├── entrypoint.sh └── README.md /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !entrypoint.sh 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | data/ 2 | gamefiles/ 3 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | 3 | RUN dpkg --add-architecture i386 && \ 4 | apt-get update && \ 5 | echo steam steam/question select "I AGREE" | debconf-set-selections && \ 6 | echo steam steam/license note '' | debconf-set-selections && \ 7 | DEBIAN_FRONTEND=noninteractive apt-get install -y wine64 steamcmd && \ 8 | apt-get clean autoclean && \ 9 | apt-get autoremove -y && \ 10 | rm -rf /var/lib/apt/lists/* 11 | 12 | ENV PATH="$PATH:/usr/games" 13 | 14 | WORKDIR /steamcmd 15 | 16 | COPY ./entrypoint.sh /entrypoint.sh 17 | ENTRYPOINT ["bash", "/entrypoint.sh"] 18 | -------------------------------------------------------------------------------- /docker-compose.yml.example: -------------------------------------------------------------------------------- 1 | services: 2 | abiotic-server: 3 | image: "ghcr.io/pleut/abiotic-factor-linux-docker:latest" 4 | restart: unless-stopped 5 | volumes: 6 | - "./gamefiles:/server" 7 | - "./data:/server/AbioticFactor/Saved" 8 | environment: 9 | - MaxServerPlayers=6 10 | - Port=7777 11 | - QueryPort=27015 12 | - ServerPassword=password 13 | - SteamServerName=Linux Server 14 | - UsePerfThreads=true 15 | - NoAsyncLoadingThread=true 16 | - WorldSaveName=Cascade 17 | # - AutoUpdate=true 18 | # - AdditionalArgs=-SandboxIniPath=Config/WindowsServer/Server1Sandbox.ini 19 | ports: 20 | - "0.0.0.0:7777:7777/udp" 21 | - "0.0.0.0:27015:27015/udp" 22 | -------------------------------------------------------------------------------- /.github/workflows/build-container.yml: -------------------------------------------------------------------------------- 1 | name: Build and deploy container to GHCR 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | workflow_dispatch: 8 | 9 | jobs: 10 | build-and-deploy: 11 | runs-on: ubuntu-latest 12 | 13 | steps: 14 | - name: Checkout repository 15 | uses: actions/checkout@v4 16 | 17 | - name: Login to GHCR 18 | uses: docker/login-action@v3 19 | with: 20 | registry: ghcr.io 21 | username: ${{ github.actor }} 22 | password: ${{ secrets.GITHUB_TOKEN }} 23 | 24 | - name: Docker meta 25 | id: meta 26 | uses: docker/metadata-action@v5 27 | with: 28 | images: ghcr.io/${{ github.repository }} 29 | tags: latest 30 | 31 | - name: Build and push container 32 | uses: docker/build-push-action@v5 33 | with: 34 | context: . 35 | file: ./Dockerfile 36 | platforms: linux/amd64 37 | push: true 38 | tags: ${{ steps.meta.outputs.tags }} -------------------------------------------------------------------------------- /entrypoint.sh: -------------------------------------------------------------------------------- 1 | SetUsePerfThreads="-useperfthreads " 2 | if [[ $UsePerfThreads == "false" ]]; then 3 | SetUsePerfThreads="" 4 | fi 5 | 6 | SetNoAsyncLoadingThread="-NoAsyncLoadingThread " 7 | if [[ $NoAsyncLoadingThread == "false" ]]; then 8 | SetNoAsyncLoadingThread="" 9 | fi 10 | 11 | MaxServerPlayers="${MaxServerPlayers:-6}" 12 | Port="${Port:-7777}" 13 | QueryPort="${QueryPort:-27015}" 14 | ServerPassword="${ServerPassword:-password}" 15 | SteamServerName="${SteamServerName:-LinuxServer}" 16 | WorldSaveName="${WorldSaveName:-Cascade}" 17 | AdditionalArgs="${AdditionalArgs:-}" 18 | 19 | # Check for updates/perform initial installation 20 | if [ ! -d "/server/AbioticFactor/Binaries/Win64" ] || [[ $AutoUpdate == "true" ]]; then 21 | steamcmd \ 22 | +@sSteamCmdForcePlatformType windows \ 23 | +force_install_dir /server \ 24 | +login anonymous \ 25 | +app_update 2857200 validate \ 26 | +quit 27 | fi 28 | 29 | pushd /server/AbioticFactor/Binaries/Win64 > /dev/null 30 | wine AbioticFactorServer-Win64-Shipping.exe $SetUsePerfThreads$SetNoAsyncLoadingThread-MaxServerPlayers=$MaxServerPlayers \ 31 | -PORT=$Port -QueryPort=$QueryPort -ServerPassword=$ServerPassword \ 32 | -SteamServerName="$SteamServerName" -WorldSaveName="$WorldSaveName" -tcp $AdditionalArgs 33 | popd > /dev/null 34 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Abiotic Factor Linux Docker 2 | For operating a dedicated server in Docker in order to use it under Linux. 3 | The container uses Wine to run the server under Linux. 4 | 5 | ## Setup 6 | 1. Create a new empty directory in any location with enough storage space. 7 | 2. Create a file named `docker-compose.yml` and copy the content of [`docker-compose.yml.example`](docker-compose.yml.example) into it. 8 | 3. In the `docker-compose.yml` file, the environment variables `ServerPassword` and `SteamServerName` should be adjusted. 9 | 4. Setup and start via docker-compose by running the command `docker-compose up -d`. 10 | * This will run the server in the background and autostart it whenever the docker daemon starts. If you do not want this, remove `-d` from the command above. 11 | * This will download the Dedicated Server binaries and game files to the `gamefiles` directory. 12 | * Persistent save file data will be written to the `data` directory. 13 | 14 | ## Update 15 | There are two ways to update the game server: 16 | 17 | 1. By setting the `AutoUpdate` environment variable to `true`. This checks for updates every time the container is started. 18 | 2. By deleting the `gamefiles` directory while the server is turned off. 19 | 20 | ### Updating the container 21 | Sometimes, changes to this container image are necessary. To apply these: 22 | 23 | 1. Merge the content of `docker-compose.yml` with any changes made from [`docker-compose.yml.example`](docker-compose.yml.example). 24 | 2. Run `docker-compose pull` to download an updated version of the container image. 25 | 26 | ## Configuration 27 | An example configuration for docker-compose can be found in the `docker-compose.yml` file. 28 | In addition to the default settings, which can be set via the environment variables, further arguments can be specified via the `AdditionalArgs` environment variable. 29 | 30 | Possible launch parameters and further information on the dedicated servers for Abiotic Factor can be found [here](https://github.com/DFJacob/AbioticFactorDedicatedServer/wiki/Technical-%E2%80%90-Launch-Parameters). 31 | 32 | ## Credits 33 | Thanks to @sirwillis92 for finding a solution to the startup problem with the `LogOnline: Warning: OSS: Async task 'FOnlineAsyncTaskSteamCreateServer bWasSuccessful: 0' failed in 15` message. --------------------------------------------------------------------------------