Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
beebf1e
Rework
panromir May 23, 2024
8117bc6
remove start.sh
panromir May 23, 2024
fc5d673
fix base distro type
panromir May 23, 2024
f6430f6
add dockerignore, reset maintainer
panromir May 23, 2024
6470b8e
Remove STEAM_USER_UID, remove docker-compose env quotes
panromir May 24, 2024
e831db9
Add docker-compose information to README
panromir May 24, 2024
6837b0d
add config replacement override
panromir May 24, 2024
79aafa1
add daily log rotation
panromir May 24, 2024
d7f52e5
Update Dockerfile
kevinf100 May 24, 2024
e791364
Update docker-compose.yml
kevinf100 May 24, 2024
d17f452
Update README.md
kevinf100 May 24, 2024
928f1ac
Update docker-compose.yml
kevinf100 May 24, 2024
a0de0bb
Update Dockerfile
panromir May 24, 2024
5834549
Update README.md
panromir May 24, 2024
5922ac1
fix typo
panromir May 24, 2024
51f98b1
Merge pull request #1 from kevinf100/main
panromir May 25, 2024
a5ce0a2
fix typos
panromir May 25, 2024
05ee867
Always write current log path
panromir May 27, 2024
38fb6ed
add supervisord
panromir May 28, 2024
cede69c
Update supervisord.conf
kevinf100 May 29, 2024
cdc0840
Update supervisord.conf
kevinf100 May 29, 2024
a94b907
Update Dockerfile
kevinf100 May 29, 2024
5475249
Update supervisord.conf
kevinf100 May 29, 2024
913a6db
remove unnecessary startup overrides
panromir May 31, 2024
24d85ad
re-add standardpvp and override_config
panromir Jun 1, 2024
4616796
Merge pull request #2 from kevinf100/main
panromir Jun 1, 2024
43876ea
Expand on OVERRIDE_CONFIG param
panromir Jun 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
assets/
kubernetes/
.gitignore
docker-compose.yml
109 changes: 76 additions & 33 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,80 @@
FROM ubuntu:22.04
FROM cm2network/steamcmd:root-bookworm
LABEL maintainer="Tim Chaubet"
VOLUME ["/mnt/vrising/server", "/mnt/vrising/persistentdata"]
#VOLUME ["/home/steam/vrising/server", "/home/steam/vrising/persistentdata"]
EXPOSE 9876/udp
# Expose 9876/tcp if using RCON. See RCON_PORT Env variable
EXPOSE 9876
EXPOSE 9877/udp

ARG DEBIAN_FRONTEND="noninteractive"
RUN apt update -y && \
apt-get upgrade -y && \
apt-get install -y apt-utils && \
apt-get install -y software-properties-common \
tzdata && \
add-apt-repository multiverse && \
# Let the user change the user and group ID
ARG STEAM_USER_UID="1000"
ARG STEAM_USER_GID="1000"
ARG SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.2.29/supercronic-linux-amd64
ARG SUPERCRONIC=supercronic-linux-amd64
ARG SUPERCRONIC_SHA1SUM=cd48d45c4b10f3f0bfdd3a57d054cd05ac96812b

ENV SERVER_DATA_PATH="/home/steam/vrising/server" \
PERSISTENT_DATA_PATH="/home/steam/vrising/persistentdata" \
HOST_SETTINGS_NAME="My Docker V-Rising Server" \
HOST_SETTINGS_DESCRIPTION="V Rising Server hosted by Docker" \
HOST_SETTINGS_PASSWORD="" \
HOST_SETTINGS_MAX_CONNECTED_USERS="10" \
HOST_SETTINGS_MAX_CONNECTED_ADMINS="4" \
HOST_SETTINGS_SERVER_ADMIN_LIST="" \
HOST_SETTINGS_SERVER_FPS="30" \
HOST_SETTINGS_RCON_ENABLE="false" \
HOST_SETTINGS_RCON_PASSWORD="Ch8ng3m3Pl3@s3!" \
HOST_SETTINGS_RCON_PORT="9876" \
HOST_SETTINGS_AUTOSAVE_COUNT="40" \
HOST_SETTINGS_AUTOSAVE_INTERVAL="120" \
HOST_SETTINGS_LISTEN_ON_STEAM="true" \
HOST_SETTINGS_LISTEN_ON_EOS="true" \
GAME_SETTINGS_PRESET="StandardPvP" \
GAME_SETTINGS_DIFFICULTY="Normal" \
LIST_ON_MASTER_SERVER="true" \
SERVER_IP="127.0.0.1" \
SAVE_NAME="world1" \
GAME_PORT="9876" \
QUERY_PORT="9877" \
DEBUG_ENV="true" \
LOGDAYS="30" \
OVERRIDE_CONFIG="true" \
TZ="Europe/Brussels"

COPY --chown=${STEAM_USER_UID}:${STEAM_USER_GID} --chmod=744 files /home/steam/files/
COPY src/debian.sources /etc/apt/sources.list.d/debian.sources

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# hadolint ignore=DL3008
RUN DEBIAN_FRONTEND=noninteractive \
dpkg --add-architecture i386 && \
apt update -y && \
apt-get upgrade -y
RUN useradd -m steam && cd /home/steam && \
echo steam steam/question select "I AGREE" | debconf-set-selections && \
echo steam steam/license note '' | debconf-set-selections && \
apt purge steam steamcmd && \
apt install -y gdebi-core \
libgl1-mesa-glx:i386 \
wget && \
apt install -y steam \
steamcmd && \
ln -s /usr/games/steamcmd /usr/bin/steamcmd
#RUN apt install -y mono-complete
RUN apt install -y wine \
winbind \
winetricks
RUN apt install -y xserver-xorg \
xvfb
RUN rm -rf /var/lib/apt/lists/* && \
apt clean && \
apt autoremove -y
apt-get update && \
apt-get install -y --no-install-recommends \
supervisor \
cron \
gettext-base \
procps \
wine \
wine32 \
wine64 \
winbind \
xvfb \
xauth \
mingw-w64 \
screen && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
usermod -u "${STEAM_USER_UID}" steam && groupmod -g "${STEAM_USER_GID}" steam && \
chmod +x /home/steam/files/scripts/* && \
curl -fsSLO "$SUPERCRONIC_URL" && \
echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - && \
chmod +x "$SUPERCRONIC" && \
mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" && \
ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic && \
chown -R "${STEAM_USER_UID}:${STEAM_USER_GID}" /home/steam

USER steam

COPY start.sh /start.sh
RUN chmod +x /start.sh
CMD ["/start.sh"]
CMD ["/home/steam/files/scripts/entrypoint.sh"]
HEALTHCHECK --start-period=180s \
CMD /bin/bash /home/steam/files/scripts/healthcheck.sh
144 changes: 83 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<a href="https://github.com/TrueOsiris/docker-vrising">
<img alt="Iroh" src="https://github.com/TrueOsiris/docker-vrising/blob/main/assets/docker-virising.png?raw=true" height="250">
</a>
<p align="center">Dockerized V Rising dedicated server in an Ubuntu 22.04 container with Wine.</p>
<p align="center">Dockerized V Rising dedicated server in an Debian 12 container with Wine.</p>
</p>

[![Docker Pulls](https://badgen.net/docker/pulls/trueosiris/vrising?icon=docker&label=pulls)](https://hub.docker.com/r/trueosiris/vrising/)
Expand Down Expand Up @@ -31,36 +31,75 @@

- The game is working perfectly with a new run of the container (from scratch). I'm on it with several buddies and <i>tested</i> for 3 hours.
- When the server is passworded, joining via Steam seems <b>not</b> possible. Use the ingame server list to join.
- Make sure `"ListOnSteam": true,` and `"ListOnEOS": true` are set in the ServerHostSettings.json in \persistentdata, so the server is visible in the serverlist
- Make sure `HOST_SETTINGS_LISTEN_ON_STEAM: "true"` and `HOST_SETTINGS_LISTEN_ON_EOS: "true"` are set in your Environment
- Launching the server can take up to 10 minutes, even on a fast system, certainly with an existing save. Below is a screenshot of the end of the docker log of a functioning server, at the time we are able to connect to it.

## Environment variables


| Variable | Key | Description |
| ------------ | ------------------------ | ----------------------------------------------------------------------------------- |
| TZ | Europe/Brussels | timezone for ntpdate |
| SERVERNAME | published servername | mandatory setting that overrules the ServerHostSettings.json entry |
| WORLDNAME | optional worldname | default = world1. No real need to alter this. saves will be in a subdir WORLDNAME |
| GAMEPORT | optional game udp port | to overrule Port in ServerHostSettings.json config |
| QUERYPORT | optional query port | to overrule QueryPort in ServerHostSettings.json config |
| LOGDAYS | optional lifetime of logfiles | overrule default of 30 days |
| Variable | Default V(alue) | Description | Mandatory |
| --------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------- | --------- |
| TZ | Europe/Brussels | timezone for ntpdate | No |
| SERVER_DATA_PATH | /home/steam/vrising/server | Path inside the container to save server files to | No |
| PERSISTENT_DATA_PATH | /home/steam/vrising/persistentdata | Path inside the container to save world/configs/logs/etc. to | No |
| HOST_SETTINGS_NAME | My Docker V-Rising Server | The name of your server as visible in the server list | No |
| HOST_SETTINGS_DESCRIPTION | V Rising Server hosted by Docker | Description of your server | No |
| HOST_SETTINGS_PASSWORD | "" | Optional server password | No |
| HOST_SETTINGS_MAX_CONNECTED_USERS | 10 | Maximum connected users | No |
| HOST_SETTINGS_MAX_CONNECTED_ADMINS| 4 | Maximum connected admins | No |
| HOST_SETTINGS_SERVER_ADMIN_LIST | "" | Comma separated list of Admin Steam ID64s (e.g. "123456789,0987654321") | No |
| HOST_SETTINGS_SERVER_FPS | 30 | Server FPS | No |
| HOST_SETTINGS_RCON_ENABLE | "false" | Whether to enable RCON | No |
| HOST_SETTINGS_RCON_PASSWORD | "Ch8ng3m3Pl3@s3!" | RCON Password [Requires: HOST_SETTINGS_RCON_ENABLE=true] | No |
| HOST_SETTINGS_RCON_PORT | "9876" | RCON TCP Port to listen on | No |
| HOST_SETTINGS_AUTOSAVE_COUNT | 40 | How many autosaves to keep | No |
| HOST_SETTINGS_AUTOSAVE_INTERVAL | 120 | Interval in seconds for the server to autosave | No |
| HOST_SETTINGS_LISTEN_ON_STEAM | "true" | Whether to listen on steam | No |
| HOST_SETTINGS_LISTEN_ON_EOS | "true" | Whether to listen on EOS | No |
| GAME_SETTINGS_PRESET | "StandardPvP" | Game Settings preset to start the server with | No |
| GAME_SETTINGS_DIFFICULTY | "Normal" | Server default difficulty setting | No |
| LIST_ON_MASTER_SERVER | "true" | Whether to list the Server on Master Servers | No |
| SERVER_IP | "127.0.0.1" | Public facing Server IP - **You might have to experiment with this** | Maybe |
| SAVE_NAME | "default_world" | The name of your map | No |
| GAME_PORT | "9876" | UDP Port for game connections | No |
| QUERY_PORT | "9877" | UDP Port to query the server on | No |
| DEBUG_ENV | "true" | Return all variables to the stdout on container start | No |
| LOGDAYS | 30 | Number of days after which logs are deleted after their last modification | No |
| OVERRIDE_CONFIG | true | Whether to generate new configs at the start of the container. | No |


## A note on `OVERRIDE_CONFIG`
By default, this parameter is set to true. Any configuration should be done using the Environment Variables, changing your configs by going into your container or editing the files on your mounted file system path will be **overwritten every time the container starts**.
If you set this to `false`, the following will happen:
- When configs already exist, they are **not** overwritten
- When no configs exist, a default config is written **once** with any Environment variables you set, otherwise the defaults are used.

## Changing the running UID/GID

If you want to change the UID/GID of the User that's running the container for any reason, you can change the **Build ARGs**. The Image uses UID/GID 1000/1000 by default as defined in `cm2network/steamcmd:root-bookworm`.
Please note that changing this also means that you might have to adjust your volume permissions on the host when using docker. When using Kubernetes, you should verify the securityContext.

| Variable | Default V(alue) | Description | Mandatory |
| --------------------------------- | ----------------------------------- | ----------------------------------------------------------------------------------- | --------- |
| STEAM_USER_UID | 1000 | The user ID the server will run on | No |
| STEAM_USER_GID | 1000 | The group ID the server will run on | No |

## Ports


| Exposed Container port | Type | Default |
| ------------------------ | ------ | --------- |
| 9876 | UDP | ✔️ |
| 9876 | TCP | ❌ |
| 9877 | UDP | ✔️ |

## Volumes


| Volume | Container path | Description |
| -------------------- | ----------------------------- | ----------------------------------------- |
| steam install path | /mnt/vrising/server | path to hold the dedicated server files |
| world | /mnt/vrising/persistentdata | path that holds the world files |
| steam install path | /home/steam/vrising/server | path to hold the dedicated server files |
| world | /home/steam/vrising/persistentdata | path that holds the world files |

## Docker cli

Expand All @@ -69,41 +108,35 @@ docker run -d --name='vrising' \
--net='bridge' \
--restart=unless-stopped \
-e TZ="Europe/Paris" \
-e SERVERNAME="trueosiris-V" \
-v '/path/on/host/server':'/mnt/vrising/server':'rw' \
-v '/path/on/host/persistentdata':'/mnt/vrising/persistentdata':'rw' \
-e HOST_SETTINGS_NAME="trueosiris-V" \
-v '/path/on/host/server':'/home/steam/vrising/server':'rw' \
-v '/path/on/host/persistentdata':'/home/steam/vrising/persistentdata':'rw' \
-p 9876:9876/udp \
-p 9877:9877/udp \
'trueosiris/vrising'
```

## docker-compose.yml

```yaml
services:
vrising:
image: trueosiris/vrising
environment:
- TZ=Europe/Paris
- SERVERNAME=vrising-TrueOsiris
volumes:
- type: bind
source: /your/host/vrising/server
target: /mnt/vrising/server
bind:
create_host_path: true
- type: bind
source: /your/host/vrising/persistentdata
target: /mnt/vrising/persistentdata
bind:
create_host_path: true
ports:
- '9876:9876/udp'
- '9877:9877/udp'
restart: unless-stopped
network_mode: bridge
See the example docker-compose.yml in this repository.
Do not put any of your env variables in the "environment:" section in quotes.

**IMPORTANT**: The compose file will create the path you define in `source` if it does not exist. Ensure you're either running with UID/GID 1000 (the default steam user in the container), change owners of these folders accordingly, or setup the `STEAM_USER_UID` and `STEAM_USER_GID` arguments correctly and rebuild the image. Otherwise you will get the following error:

```
mkdir: cannot create directory '/home/steam/vrising/persistentdata/Settings': Permission denied
```

## Kubernetes

You can use the provided example in `kubernetes/kustomize/overlays/exampleorg` to see the ways the base template could be adjusted to your requirements.
It's important to *at least* change the following:
- secret.yaml - Your RCON Secret, if you need one
- pvc.yaml - Adjust `storageClassname` and requsted storage according to your needs
- deployment.yaml - Set Image path to your registry. This image is not pushed to dockerhub by default

To update your Pod, just delete it and wait for it to restart.

## Links

- [V Rising Dedicated Server Instructions](https://github.com/StunlockStudios/vrising-dedicated-server-instructions)
Expand All @@ -112,40 +145,29 @@ services:

## RCON <small>- Optional</small>

To enable RCON edit `ServerHostSettings.json` and paste following lines after `QueryPort`. To communicate using RCON protocal use the [RCON CLI](https://github.com/gorcon/rcon-cli) by gorcon.
To enable RCON set the `HOST_SETTINGS_RCON_ENABLE`, `HOST_SETTINGS_RCON_PASSWORD`, `HOST_SETTINGS_RCON_PORT` variables. To communicate using RCON protocal use the [RCON CLI](https://github.com/gorcon/rcon-cli) by gorcon.

```json
"Rcon": {
"Enabled": true,
"Password": "docker",
"Port": 25575
},
```

## Remarks

- Server config files are in `/path/on/host/persistentdata/Settings`. Files in `/path/on/host/server/` are overwritten on Steam update. <br>
Priority of settings is

a. container variables

b. files in /persistentdata
- Server config files are in `/path/on/host/persistentdata/Settings`.
Files in `/path/on/host/server/` are overwritten on Steam update. <br>
Priority of settings is

c. files in /server. (and these are reset to defaults each new patch)
- container variables
- files in /server. (and these are reset to defaults each new patch)

If there are no files in `/path/on/host/persistentdata/Settings` on container start, the default files will be copied there from the /server directory.<br>
Edit `ServerHostSettings.json` if you want to change the ports, descriptions etc.
- Description can be changed in `/path/on/host/persistentdata/Settings/ServerHostSettings.json`. The server will have to be restarted after changes.
Please note that you cannot edit your config files in `$PERSISTENT_DATA_PATH/Settings/ServerGameSettings.json` or `$PERSISTENT_DATA_PATH/Settings/ServerHostSettings.json`, these will be overwritten by your ENV every time the container is restarted by default. In case you want to adjust any setting that isn't covered by the current config options, please create an issue or a PR.
If you want to manually adjust your configs and keep your changes, move your config files (with proper access rights) to your mounted folder and set `OVERRIDE_CONFIG="false"`
- If you use different internal & external ports, you can only use direct connect. For example `-p 12345:6789/udp` container port 6789 as defined in ServerHostSettings.json, and exposed as 12345 will make your server invisible ~~, even if `"ListOnMasterServer=true"`~~
- Make sure `"ListOnSteam": true,` and `"ListOnEOS": true` are set in the ServerHostSettings.json in \persistentdata, so the server is visible in the serverlist.
- If you want to see the server in the server list and want to use 27015-27016/UDP, you'll need to change the ports in the ServerHostSettings.json file to 27015 and 27016. Then expose these ports (below). Of course, forward these udp ports on your firewall from incoming wan to the ports on the internal ip of your dockerhost.
- If you want to see the server in the server list and want to use 27015-27016/UDP, you'll need to change the ports to 27015 and 27016. Then expose these ports (below). Of course, forward these udp ports on your firewall from incoming wan to the ports on the internal ip of your dockerhost.

- Start the container & let the server install.
- Stop the container.
- Alter the ports in `/path/on/host/persistentdata/Settings/ServerHostSettings.json` to
- Alter the ports to
```
"Port": 27015,
"QueryPort": 27016,
GAME_PORT: "27015"
QUERY_PORT: "27016"
```
- On your firewall, port forward incoming wan udp ports 27015 and 27016 to the same udp ports on your dockerhost ip.
- Restart the container with these ports:
Expand Down
Loading