From 4301dc3e6cf4641a7f803723c4dd4d9f58ae4d6b Mon Sep 17 00:00:00 2001 From: Maik Laschober Date: Tue, 18 Aug 2020 07:43:46 +0200 Subject: [PATCH] updated composer using custom build Dockerfile --- Dockerfile | 9 +++++---- NOTE.md | 4 +++- build-custom-example/Dockerfile | 5 ++--- build-custom-example/README.md | 4 +++- build-custom-example/{run => }/docker-compose.yml | 5 +++-- 5 files changed, 16 insertions(+), 11 deletions(-) rename build-custom-example/{run => }/docker-compose.yml (75%) diff --git a/Dockerfile b/Dockerfile index 11a8bc0..28e8d15 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,10 @@ FROM alpine as downloader WORKDIR /download +ENV VSTYPE stable ENV VSVERSION 1.12.14 -RUN wget "https://cdn.vintagestory.at/gamefiles/stable/vs_server_${VSVERSION}.tar.gz" +RUN wget "https://cdn.vintagestory.at/gamefiles/${VSTYPE}/vs_server_${VSVERSION}.tar.gz" RUN tar xzf "vs_server_${VSVERSION}.tar.gz" RUN rm "vs_server_${VSVERSION}.tar.gz" @@ -20,8 +21,8 @@ COPY --from=downloader "./download/" "/game" 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}" - -# Expose ports -EXPOSE 42420/tcp \ No newline at end of file diff --git a/NOTE.md b/NOTE.md index ad89af4..953c3cb 100644 --- a/NOTE.md +++ b/NOTE.md @@ -7,11 +7,13 @@ docker build -t devidian/vintagestory . #push docker push devidian/vintagestory #run -docker run -pd 42420:42420 --name VintageStoryServer vintagestory +docker run -pd 42420:42420 --name VintageStoryServer devidian/vintagestory # -------------------------------------- # --------- using composer ------------- #start docker-compose up -d +#rebuild +docker-compose up -d --build #stop docker-compose down ``` \ No newline at end of file diff --git a/build-custom-example/Dockerfile b/build-custom-example/Dockerfile index 0de3cf3..2d885b3 100644 --- a/build-custom-example/Dockerfile +++ b/build-custom-example/Dockerfile @@ -8,9 +8,8 @@ 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}" - -# Expose ports -EXPOSE 42420/tcp \ No newline at end of file diff --git a/build-custom-example/README.md b/build-custom-example/README.md index 8e4cbad..c22232c 100644 --- a/build-custom-example/README.md +++ b/build-custom-example/README.md @@ -2,13 +2,15 @@ You can use this `Dockerfile` to create your own serverconfig using `devidian/vintagestory` as base. Just edit serverconfig.json and run `docker build -t YOUR_IMAGE_NAME`. You may also add / override additional files like mods. ## Run custom docker image -to run the image you can either use `docker run -pd 42420:42420 --name VintageStoryServer YOUR_IMAGE_NAME` or use the composer file as follows (dont forget to change `YOUR_IMAGE_NAME` in `docker-composer.yml`) +to run the image you can either use `docker run -pd 42420:42420 --name VintageStoryServer YOUR_IMAGE_NAME` or use the composer file as follows. ```bash cd run; #start docker-compose up -d +#rebuild / update +docker-compose up -d --build #stop docker-compose down ``` \ No newline at end of file diff --git a/build-custom-example/run/docker-compose.yml b/build-custom-example/docker-compose.yml similarity index 75% rename from build-custom-example/run/docker-compose.yml rename to build-custom-example/docker-compose.yml index d6976be..515ea6a 100644 --- a/build-custom-example/run/docker-compose.yml +++ b/build-custom-example/docker-compose.yml @@ -1,9 +1,10 @@ -version: '3' +version: '3.1' services: vsserver: - image: YOUR_IMAGE_NAME + build: . container_name: vsserver + restart: always volumes: - gamedata:/gamedata ports: