Generate a game server Dockerfile
edgegap_generate_dockerfileWrites a Dockerfile for a project's headless game server build, ready for Edgegap, with engine-specific flags, ports, and non-root user settings.
Instructions
Write a Dockerfile for this project's headless game server build, ready for Edgegap: linux/amd64 base, the build folder copied in, the binary made executable, the right headless flags (Unity -batchmode -nographics, Godot --headless), a non-root user where the engine needs it (Unreal refuses root), CRLF fixes for start scripts, and EXPOSE lines matching the ports. Call this when the project has no Dockerfile, before building anything. Look at the build output first so you can pass the real build folder, binary name and port; anything you omit is assumed and listed under assumptions, which you must confirm with the developer or the project files. Write the result to Dockerfile, then build. The output is checked against edgegap_validate_server_config before it is returned. Makes no API calls.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ports | No | Ports the server listens on. Default: 7777, with the protocol the netcode uses (UDP if unknown). | |
| engine | Yes | Game engine of the server build. | |
| netcode | No | Networking transport, to pick the protocol. Known: mirror-kcp, kcp, mirror-telepathy, telepathy, mirror-simpleweb, simpleweb, websocket, fishnet-tugboat, tugboat, netcode-for-gameobjects, ngo, unity-transport, utp, photon-fusion, litenetlib, enet, unreal-netdriver, godot-enet, godot-websocket. | |
| base_image | No | Default "ubuntu:22.04". | |
| build_path | No | Server build folder, relative to where docker build runs. Defaults: unity "Builds/EdgegapServer", unreal "." (run from inside the packaged LinuxServer folder), godot "build". | |
| executable | No | File name of the server binary or start script inside build_path. Defaults: unity "ServerBuild", unreal "StartServer.sh", godot "server.x86_64". Required for "other". | |
| launch_args | No | Extra server arguments, one per entry, e.g. ["-log", "-port=7777"]. |