The official docker image is located at agbowlin/serverkit:latest
.
docker pull agbowlin/serverkit:latest
The image has nodejs and @liquicode/serverkit
installed and will run the serverkit.js
cli.
docker run agbowlin/serverkit:latest --version
The above command prints something like:
ServerKit v0.0.28 (@liquicode/lib-server-kit@0.0.28)
Selection of network ports is performed through configuration settings.
The default port values are:
8080
: Used if the Web transport is enabled.8081
: Used if the WebSocket transport is enabled.SERVERKIT_NAME
: The name of your server (e.g. MathsServer), This value is optional yet recommended. It may be used in log messages and other visual elements.
SERVERKIT_FOLDER
: The folder where your server files are located. For SererKit to do anything interesting, like serve your files, it needs to know where these files will be located. Inside of a running container, ServerKit will look for files within the /server
folder. This should be bound to some local folder on the host containing your server files. This is also the location where any generated files will be written to.
SERVERKIT_OPTIONS
: The name of the options file to use. This filename is relative to the server folder. The options file supplies all of the parameters needed to get ServerKit up and running. Without providing any custom settings or options file, ServerKit will still function as a CLI interface to your server and services.
Since ServerKit requires a folder containing custom services and settings, usage of the ServerKit Docker Image requires you specify such a folder:
docker run --mount type=bind,source=~/MyServer,target=/server agbowlin/serverkit
Run ServerKit in the Current Working Directory (Linux)
docker run -it \
--name MyServer \
--publish 8080:8080/tcp \
--publish 8081:8081/tcp \
--mount type=bind,source=$(pwd),target=/server \
agbowlin/serverkit \
--shell run
Run ServerKit in the Current Working Directory (Windows)
docker run -it ^
--name MyServer ^
--publish 8080:8080/tcp ^
--publish 8081:8081/tcp ^
--mount type=bind,source=%cd%,target=/server ^
agbowlin/serverkit ^
--shell run