This repo provides the necessary code to create a Space Engineers dedicated server docker image.
This docker image is hosted on the Docker hub. You can pull this image at docker.io/benfiola/space-engineers:latest.
The docker image is configured purely through the environment:
| Variable | Default | Description |
|---|---|---|
| CACHE_ENABLED | "false" | Cache dedicated server and mod files |
| CACHE_SIZE_LIMIT | "0" | Size limit of file cache |
| GID | 1000 | The GID to run the server as |
| MANIFEST_ID | The manifest ID (of the 7DTD dedicated server) to download. Use SteamDB to find the current manifest ID. | |
| MOD_URLS | A comma-separated list of URLs to be downloaded and extracted to the [server]/Mods folder |
|
| UID | 1000 | The UID to run the server as |
On startup, the docker image will attempt to download the SE dedicated server version defined by the MANIFEST_ID environmnent variable.
To prevent unnecessary rebuilds, this entrypoint supports file caching. If you mount a local path to /cache, and set CACHE_ENABLED="true" - the file cache is enabled. You can customize file cache sizes by setting the CACHE_SIZE_LIMIT environment variable to a size (in megabytes).
Important
If the file cache is enabled, the entrypoint will fail if the size limit is less than the size of the dedicated server + mods - ensure to give your file cache sufficient space!
The docker image is configured to host server data in the /data folder. For persistence, you will need to mount a local path (or, PersistentVolume if Kubernetes) to the /data folder.
The docker image is configured to run under a non-root user.
If a container is run as the root user, the entrypoint will attempt to take ownership of necessary files under the values of environment variables UID and GID and relaunch itself.
If a container is run as a non-root user, the entrypoint will run as this non-root user. It's assumed that necessary files are already owned by the current non-root user.
You can perform a health check on a running server by running the /entrypoint health command. This is useful for configuring things like Kubernetes liveness/readiness probes.
The entrypoint is implemented in golang and is defined at ./entrypoint.go. It's (hopefully) well-documented - feel free to take a look!
This project was written using VSCode and the devcontainers extension. Use these for a streamlined development experience.
PRs and feedback are welcome.