Skip to content
This repository has been archived by the owner on Jun 4, 2024. It is now read-only.

Added docker compose #5

Closed
wants to merge 3 commits into from
Closed

Added docker compose #5

wants to merge 3 commits into from

Conversation

spannerman79
Copy link

@spannerman79 spannerman79 commented Mar 19, 2021

Closes #2

@spannerman79 spannerman79 marked this pull request as ready for review March 19, 2021 09:24
@spannerman79
Copy link
Author

If you want me to include details about modded servers into the README.md let me know before accepting the PR

README.md Outdated Show resolved Hide resolved
@Hetsh
Copy link
Owner

Hetsh commented Mar 19, 2021

Please remove the -example from the docker-compose filename.

docker-compose-example.yml Outdated Show resolved Hide resolved
@spannerman79 spannerman79 changed the title Added docker compose example Added docker compose Mar 19, 2021
docker-compose-example.yml Outdated Show resolved Hide resolved
version: "3.3"
services:
stationeers:
container_name: stationeers # Change me if needed
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
container_name: stationeers # Change me if needed
container_name: stationeers

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is obvious to everybody.

Comment on lines +5 to +6
# stdin_open: true # docker run -i - uncomment for testing
# tty: true # docker run -t - uncomment for testing
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# stdin_open: true # docker run -i - uncomment for testing
# tty: true # docker run -t - uncomment for testing

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as i know, stationeers does not accept any user input via cli, does it?

Copy link
Author

@spannerman79 spannerman79 Mar 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It accepts SIGINT, which if you use something like portainer it is needed. Hence the uncomment for testing (portainer needs both -t -i to attach unless you have paid the licence for it).

Sending SIGINT while in interactive the server will save and shut down clean. Otherwise you need to conntect, /login adminpass or RCON, login rconpass, then save save_name beforehand. For some reason stopping the container before saving changes aren't written to disk. (known server issue)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't STOPSIGNAL solve this issue? Sending signals to a process should not require STDIN or a TTY.

Copy link
Owner

@Hetsh Hetsh Mar 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But i did not know that you could type commands on the CLI, so there might be a need to keep STDIN attached. Can you piont me to the related documentation?

Comment on lines +8 to +10
- "27500:27500/udp" # Game Port - default 27500/udp
- "27500:27500/tcp" # Web RCON Port - Same as Game port - default 27500/tcp
- "27015:27015/udp" # Steam Update Port - default 27015/udp
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- "27500:27500/udp" # Game Port - default 27500/udp
- "27500:27500/tcp" # Web RCON Port - Same as Game port - default 27500/tcp
- "27015:27015/udp" # Steam Update Port - default 27015/udp
- "27500:27500/udp" # Game Port (required) - client-server communication
- "27500:27500/tcp" # RCON Port (optional) - server control via network
- "27015:27015/udp" # Steam Port (recommended - required for public server listing)

- "27500:27500/udp" # Game Port - default 27500/udp
- "27500:27500/tcp" # Web RCON Port - Same as Game port - default 27500/tcp
- "27015:27015/udp" # Steam Update Port - default 27015/udp
image: hetsh/stationeers:latest # For Modded servers: Best you define the exact label.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
image: hetsh/stationeers:latest # For Modded servers: Best you define the exact label.
image: hetsh/stationeers
# image: hetsh/stationeers:<manifest_id> # Modded servers should specify the label until the mod is updated

Comment on lines +13 to +17
- WORLD_TYPE=Mars
- WORLD_NAME=mars_save
# - SAVE_INTERVAL=300 # Uncomment to change the save interval - default =300
# - CLEAR_INTERVAL=-1 # Uncomment to set the idle player clearing to be disabled.
# - SERVER_OPTS=-bindip x.x.x.x # Uncomment to set an IP assigned via ZeroTier running on the same docker host.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- WORLD_TYPE=Mars
- WORLD_NAME=mars_save
# - SAVE_INTERVAL=300 # Uncomment to change the save interval - default =300
# - CLEAR_INTERVAL=-1 # Uncomment to set the idle player clearing to be disabled.
# - SERVER_OPTS=-bindip x.x.x.x # Uncomment to set an IP assigned via ZeroTier running on the same docker host.
# - WORLD_TYPE=Mars # Play on Mars - default is Moon
# - WORLD_NAME=Mars_Save # Rename save - default is Base
# - SAVE_INTERVAL=120 # Increase save frequency - default is 300 seconds
# - CLEAR_INTERVAL=-1 # Disable idle player clearing - default is 60 seconds
# - SERVER_OPTS=... # Add more optional parameters

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding to a ZeroTier IP is very specific and not straight forward. This might be a superb wiki entry though, what do you think?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specifying SERVER_OPTS would have the same effect as just adding them as commands right? So it should be possible to remove the SERVER_OPTS completely.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binding to a ZeroTier IP is very specific and not straight forward. This might be a superb wiki entry though, what do you think?

Its actually very simple. I'm not thinking about 6PLANE though - that is out of the scope of even this repo.

Hard (manual) way - https://zerotier.atlassian.net/wiki/spaces/SD/pages/7536656/Running+ZeroTier+in+a+Docker+Container

Easier ( example https://hub.docker.com/r/zyclonite/zerotier/ ) way;

docker run --name zerotier-one --device=/dev/net/tun --net=host \
  --cap-add=NET_ADMIN --cap-add=SYS_ADMIN \
  -v /var/lib/zerotier-one:/var/lib/zerotier-one zyclonite/zerotier

There are quite a few already made docker containers for zero-tier. That was just one example.

Specifying SERVER_OPTS would have the same effect as just adding them as commands right? So it should be possible to remove the SERVER_OPTS completely.

Not with the way that you have done your docker. Yes you can change the entry point command after the fact but not on initial up/start.

And because you have an env var of $SERVER_OPTS its easy to define/add without the need to modify/re-spin the container, if you have a template in place with it, etc.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its actually very simple. I'm not thinking about 6PLANE though - that is out of the scope of even this repo.

Still, binding to a specific IP is not part of a standard setup. We should not include it in the example. I would rather prefer an entry in the Wiki.

Not with the way that you have done your docker. Yes you can change the entry point command after the fact but not on initial up/start.

I think you are mixing up ENTRYPOINT with CMD. You can use CMD to add parameters to an ENTRYPOINT. Exactly what SERVER_OPTS is currently used for. I opened issue #6 which we can resolve after merging the changes.

Copy link
Author

@spannerman79 spannerman79 Mar 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still, binding to a specific IP is not part of a standard setup. We should not include it in the example. I would rather prefer an entry in the Wiki.

Actully it is.

rocketstation_DedicatedServer.x86_64" -batchmode -nographics -autostart -basedirectory="$DATA_DIR" -logfile="$LOG_DIR/game.log" -autosaveinterval="$SAVE_INTERVAL" -clearallinterval="$CLEAR_INTERVAL" -worldtype="$WORLD_TYPE" -worldname="$WORLD_NAME" -loadworld="$WORLD_NAME" $SERVER_OPTS

To actually bind stationeers to an ip address when its running on a system with access to multi VLANS', etc you must use -bindip as that binds the server application to the ip.

You are confusing between docker itself and with how unity & stationeers can bind to an ip address.

It is in fact how it must be done if zero tier is running on the same hardware/vps/dedi/bare metal.

In fact if I was to start up a VM on my NAS, and I had a zero tier network connected to that VM, in order to bind stationeers to that IP, regardless of it being assigned another VLAN, by zerotier, VPN, etc you must pass -bindip x.x.x.x to it otherwise it will attempt to listen to all network interfaces, ie 0.0.0.0

Edit: In fact, direct from one of dev's, woodsshin#5778
Stationeers-DedicatedServerCommands-v0.17.pdf

Comment on lines +19 to +22
# - "/path/to/modded_data/modded.xml:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/modded.xml:ro" # Modded Servers - enforce your xml changes like this
- "/path/to/storage/:/stationeers" # persistent data storage - saves, default.ini etc
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# - "/path/to/modded_data/modded.xml:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/modded.xml:ro" # Modded Servers - enforce your xml changes like this
- "/path/to/storage/:/stationeers" # persistent data storage - saves, default.ini etc
- "/etc/localtime:/etc/localtime:ro"
- "/etc/timezone:/etc/timezone:ro"
- "/path/to/storage/logs:/var/log/stationeers" # Save game logs
- "/path/to/storage/data:/stationeers" # Persistent storage for saves, default.ini, ...
- "/etc/localtime:/etc/localtime:ro" # Correct time for logs and more
- "/etc/timezone:/etc/timezone:ro" # Correct time for logs and more
# - "/path/to/mod/modded.xml:/var/lib/steam/linux32/steamapps/content/app_600760/depot_600762/rocketstation_DedicatedServer_Data/StreamingAssets/Data/original.xml:ro" # Override original with modded .xml

@spannerman79
Copy link
Author

I withdraw my PR.

@Hetsh
Copy link
Owner

Hetsh commented Mar 21, 2021

Unfortunate, i just try to keep the setup as simple as possible for beginners. Your setup and advice would be greatly appreciated and fit better in further documentation.

Hetsh added a commit that referenced this pull request Mar 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Modded Support
2 participants