From 7c3b4c23927e15d1ef801b34b1b8964c4c95b162 Mon Sep 17 00:00:00 2001 From: Maik Laschober Date: Tue, 18 Aug 2020 08:20:45 +0200 Subject: [PATCH] moved port/env to composer for custom build --- README.md | 13 +++++-------- build-custom-example/Dockerfile | 5 ----- build-custom-example/docker-compose.yml | 4 +++- 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 040c19e..f08c25d 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ To run this image you can use `docker run -pd 42420:42420 --name VintageStorySer You can either copy files from `https://github.com/Devidian/docker-vintagestory/tree/master/build-custom-example` or follow these steps: - create a `serverconfig.json` with your settings -- create a `Dockerfile` file with contents found below (maybe adjust port) -- create a `docker-compose.yml` file with contents found below +- create a `Dockerfile` file with contents found below +- create a `docker-compose.yml` file with contents found below (adjust port/path if you need) - run `docker-compose up -d` to start - run `docker-compose up -d --build` to rebuild and restart - run `docker-compose down` to stop @@ -19,14 +19,9 @@ FROM devidian/vintagestory:latest as runtime WORKDIR /game -ENV VSDATAPATH vs-custom - # update with your own serverconfig COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" -# Expose ports -EXPOSE 42420/tcp - # CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" @@ -45,7 +40,9 @@ services: volumes: - gamedata:/gamedata ports: - - "42420:42420" + - 42420:42420 + environment: + VSDATAPATH: vs-custom volumes: gamedata: ``` diff --git a/build-custom-example/Dockerfile b/build-custom-example/Dockerfile index 2d885b3..46fe4cc 100644 --- a/build-custom-example/Dockerfile +++ b/build-custom-example/Dockerfile @@ -3,13 +3,8 @@ FROM devidian/vintagestory:latest as runtime WORKDIR /game -ENV VSDATAPATH vs-custom - # update with your own serverconfig COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" -# Expose ports -EXPOSE 42420/tcp - # CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" diff --git a/build-custom-example/docker-compose.yml b/build-custom-example/docker-compose.yml index 515ea6a..e1d9378 100644 --- a/build-custom-example/docker-compose.yml +++ b/build-custom-example/docker-compose.yml @@ -8,6 +8,8 @@ services: volumes: - gamedata:/gamedata ports: - - "42420:42420" + - 42420:42420 + environment: + VSDATAPATH: vs-custom volumes: gamedata: \ No newline at end of file