From af345fb2ae5e4563ca7c59b470046802cf4b9c6b Mon Sep 17 00:00:00 2001 From: Danielv123 Date: Fri, 7 Apr 2017 08:40:46 +0200 Subject: [PATCH] More docker --- Dockerfile | 10 ++++++++-- client.js | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f68ff19..8ca2cef0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,17 @@ FROM node:latest RUN apt-get update && apt install git -y && git clone https://github.com/Danielv123/factorioClusterio.git && cd factorioClusterio && npm install && curl -o factorio.tar.gz -L https://www.factorio.com/get-download/latest/headless/linux64 && tar -xvzf factorio.tar.gz +WORKDIR factorioClusterio + + +RUN mkdir instances sharedMods sharedPlugins +RUN node client.js download + LABEL maintainer "danielv@live.no" EXPOSE 8080 34167 - VOLUME /factorioClusterio/instances +VOLUME /factorioClusterio/sharedMods +VOLUME /factorioClusterio/sharedPlugins -WORKDIR factorioClusterio CMD node $MODE\.js start $INSTANCE \ No newline at end of file diff --git a/client.js b/client.js index 95e1f11e..3029864e 100644 --- a/client.js +++ b/client.js @@ -130,8 +130,8 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\ fs.copySync('sharedMods', instancedirectory + "/mods") let instconf = { - "factorioPort": Math.floor(Math.random() * 65535), - "clientPort": Math.floor(Math.random() * 65535), + "factorioPort": process.env.FACTORIOPORT | Math.floor(Math.random() * 65535), + "clientPort": process.env.RCONPORT | Math.floor(Math.random() * 65535), "clientPassword": Math.random().toString(36).replace(/[^a-z]+/g, '').substr(0, 8), } console.log("Clusterio | Moving shared mods...")