From aaa605df31d36e120be1529acaa79a4a5ba0b5bb Mon Sep 17 00:00:00 2001 From: Maik Laschober Date: Thu, 20 Aug 2020 09:37:34 +0200 Subject: [PATCH] added mods and playerdata to example build fix Dockerfile using ARG instead of ENV --- Dockerfile | 18 +++++++-------- README.md | 21 ++++++++++++------ build-custom-example/Dockerfile | 13 +++++++---- .../Mods/ExtendedChiselDurability.zip | Bin 0 -> 1188 bytes .../Playerdata/playerdata.json | 14 ++++++++++++ .../Playerdata/playergroups.json | 1 + .../Playerdata/playersbanned.json | 1 + .../Playerdata/playerswhitelisted.json | 1 + build-custom-example/docker-compose.yml | 8 ++++--- 9 files changed, 54 insertions(+), 23 deletions(-) create mode 100644 build-custom-example/Mods/ExtendedChiselDurability.zip create mode 100644 build-custom-example/Playerdata/playerdata.json create mode 100644 build-custom-example/Playerdata/playergroups.json create mode 100644 build-custom-example/Playerdata/playersbanned.json create mode 100644 build-custom-example/Playerdata/playerswhitelisted.json diff --git a/Dockerfile b/Dockerfile index a3561ec..e3f5804 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,26 +3,26 @@ FROM alpine as downloader WORKDIR /download -ENV VSTYPE stable -ENV VSVERSION 1.13.0 +ARG vs_type=stable +ARG vs_version=1.13.0 -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" +RUN wget "https://cdn.vintagestory.at/gamefiles/${vs_type}/vs_server_${vs_version}.tar.gz" +RUN tar xzf "vs_server_${vs_version}.tar.gz" +RUN rm "vs_server_${vs_version}.tar.gz" # ============== runtime stage ================== FROM mono:latest as runtime WORKDIR /game -ENV VSDATAPATH vs +ARG vs_data_path=/gamedata/vs COPY --from=downloader "./download/" "/game" -COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" +COPY "./serverconfig.json" "${vs_data_path}/serverconfig.json" # Expose ports EXPOSE 42420/tcp -# CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] -CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" +# Execution command +CMD mono VintagestoryServer.exe --dataPath ${vs_data_path} diff --git a/README.md b/README.md index feb7801..2c55c43 100644 --- a/README.md +++ b/README.md @@ -17,13 +17,18 @@ You can either copy files from `https://github.com/Devidian/docker-vintagestory/ # ============== runtime stage ================== FROM devidian/vintagestory:latest as runtime -WORKDIR /game +ARG vs_data_path=/gamedata/vs # update with your own serverconfig -COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" +COPY serverconfig.json ${vs_data_path}/serverconfig.json +# copy mods +#COPY Mods ${vs_data_path}/Mods/ +# copy default player data +#COPY Playerdata ${vs_data_path}/Playerdata/ -# CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] -CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" +WORKDIR /game + +CMD mono VintagestoryServer.exe --dataPath ${vs_data_path} ``` @@ -34,15 +39,17 @@ version: '3.1' services: vsserver: - build: . + build: + context: . + args: + vs_data_path: /gamedata/vs-mods/ container_name: vsserver restart: always volumes: - gamedata:/gamedata ports: - 42420:42420 - environment: - VSDATAPATH: vs-custom + volumes: gamedata: ``` diff --git a/build-custom-example/Dockerfile b/build-custom-example/Dockerfile index 46fe4cc..54e2788 100644 --- a/build-custom-example/Dockerfile +++ b/build-custom-example/Dockerfile @@ -1,10 +1,15 @@ # ============== runtime stage ================== FROM devidian/vintagestory:latest as runtime -WORKDIR /game +ARG vs_data_path=/gamedata/vs # update with your own serverconfig -COPY "./serverconfig.json" "/gamedata/${VSDATAPATH}/serverconfig.json" +COPY serverconfig.json ${vs_data_path}/serverconfig.json +# copy mods +COPY Mods ${vs_data_path}/Mods/ +# copy default player data +COPY Playerdata ${vs_data_path}/Playerdata/ -# CMD [ "mono" , "VintagestoryServer.exe", "--dataPath", "/gamedata/${VSDATAPATH}" ] -CMD mono VintagestoryServer.exe --dataPath "/gamedata/${VSDATAPATH}" +WORKDIR /game + +CMD mono VintagestoryServer.exe --dataPath ${vs_data_path} diff --git a/build-custom-example/Mods/ExtendedChiselDurability.zip b/build-custom-example/Mods/ExtendedChiselDurability.zip new file mode 100644 index 0000000000000000000000000000000000000000..829c164790af528a3c43ebfdab5faff11cd9c154 GIT binary patch literal 1188 zcmWIWW@Zs#0D;nkssJzpO0Waz#Ny)Al4AV;xS|R)MFI###id1MnPrJNNU9sqR7+q{ zU65FkoRNyKgM)#otSVrZ#nTt7fvOKOGcf4l(UqK$S)7`aQd*Rll$n!RQmL0!oS(P% z;zqth3Ic2o_WEBmxGu7~@WpBg_7%(bdT=+c_B7qMJHYqW(Z*Q?%*=o4e@wDY+c|%^ zz5QXm6%AJ{cX#n+sl3QAdEj*^YN~HHpNRIeErM6tN-E{nOjt3&&9d#7`R>duh6&R} zbDa)01uklQdN_84VomLXIsV(%KN9CtzkA=}P+ZhqdxcZmpPpHvK$P{YpMcnuP`fo4D@Y1BLf2ukj~9d$;?a3 z2Ybr3f1}?K0|A%neMwKHo(fs5d-{Xvg+Oca`-xL!Zf`PIy!i6p+^v%f^wP`j_2m02 z_YFBIoUw^;6LF7@rf^^cC@kFvXn4QR(iX@=Nx;yzfH@O)HBm} zJ@A>fCH($w%j8o_BdT^U%e{4cMMPS)bHpTbft^zJpVq(KRh=34wC4KfDQUB|YR_Bs zsMbAolj+As&s%*>@o$U^P1&AR*v&1tm|SvWhJo0Dzx)B-j7;_nxKg7EFhD>6l;l7F znl`x@6u?|Y1__3}YGtNz%-0wT*dEw}==R3)wXr}N*qC`kZszPau)0d7!9)-VH38T0<#GeCY^X}!kTZ8tyegmrdm