Class ServerPackageDockerfile
- Namespace
- Unity.Multiplayer.Core
The Dockerfile and .dockerignore for a server package, for profiles that run it as a container. The image runs
start.sh as a non-root user, exposes the declared ports, keeps Saves/ and Logs/ in volumes,
stops with SIGTERM and probes the health endpoint.
public static class ServerPackageDockerfile
- Inheritance
-
ServerPackageDockerfile
- Inherited Members
Fields
DefaultBaseImage
The base image used unless the profile names another.
public const string DefaultBaseImage = "ubuntu:24.04"
Field Value
FileName
The Dockerfile's name.
public const string FileName = "Dockerfile"
Field Value
IgnoreFileName
The .dockerignore's name.
public const string IgnoreFileName = ".dockerignore"
Field Value
User
The non-root user the server runs as.
public const string User = "server"
Field Value
WorkDir
The package folder inside the image.
public const string WorkDir = "/srv/game"
Field Value
Methods
Compose(ServerPackageSpec, string)
The Dockerfile text for spec.
public static string Compose(ServerPackageSpec spec, string baseImage = null)
Parameters
specServerPackageSpecbaseImagestring
Returns
Exceptions
- ArgumentNullException
specis null.
ComposeIgnore(ServerPackageSpec, IEnumerable<string>)
The .dockerignore: Unity's debug-symbol and backup folders, which must not ship, local logs and saves, which must not be baked into the image, and the Docker files themselves.
public static string ComposeIgnore(ServerPackageSpec spec, IEnumerable<string> alsoIgnore = null)
Parameters
specServerPackageSpecalsoIgnoreIEnumerable<string>
Returns
Exceptions
- ArgumentNullException
specis null.
ContainerPath(string)
A package folder's path inside the container: absolute paths as given, relative ones under WorkDir.
public static string ContainerPath(string directory)
Parameters
directorystring