Browse Source

doc: build instructions

Bryan Lee 1 year ago
parent
commit
3e80ff06ef
3 changed files with 37 additions and 2 deletions
  1. 0 1
      .gitignore
  2. 1 1
      build/server/Dockerfile
  3. 36 0
      build/server/README.md

+ 0 - 1
.gitignore

@@ -4,7 +4,6 @@
 # Build files 
 export/server/*
 !export/server/.gitkeep
-!export/server/Dockerfile
 export/web/*
 !export/web/.gitkeep
 export/windows/*

+ 1 - 1
export/server/Dockerfile → build/server/Dockerfile

@@ -9,7 +9,7 @@ COPY . ./
 RUN chmod +x server.x86_64
 
 # Expose the port that the application listens on.
-EXPOSE 8910
+EXPOSE 9000
 
 # Run the application.
 CMD ./server.x86_64 --server --headless

+ 36 - 0
build/server/README.md

@@ -0,0 +1,36 @@
+# Server Build
+
+## Building the image
+
+Make sure to have Docker installed.
+
+To build the game server image, run the command below from the repository root:
+
+```bash
+docker build --platform linux/x86_64 --tag {custom_tag} -f build/server/Dockerfile export/server
+```
+
+## Pushing images to Docker Hub
+
+To push the image, run:
+
+```bash
+docker image push {custom_tag}
+```
+
+> To push the image onto the Docker Hub Container Image Library, `{custom_tag}` has to be prefixed by your Docker Hub username e.g. `bryanmylee/server`.
+
+## Pulling images on servers
+
+Run a container with the latest version of the image and it will be pulled automatically.
+
+## Running containers with images
+
+Certain parts of the application are controlled via environment variables. Pass them into the container with `-e` / `--env`.
+
+```bash
+docker run --detach --name {name} --publish 19000:9000 \
+	--env SERVER_TIMEOUT=10.0 \
+	--env SERVER_ID=5432 \
+	{custom_tag}
+```