diff --git a/Dockerfile b/Dockerfile index 8ca2cef0..e3c31e92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ VOLUME /factorioClusterio/instances VOLUME /factorioClusterio/sharedMods VOLUME /factorioClusterio/sharedPlugins -CMD node $MODE\.js start $INSTANCE \ No newline at end of file +CMD node RCONPORT="$RCONPORT" FACTORIOPORT="$FACTORIOPORT" MODE="$MODE" $MODE\.js start $INSTANCE \ No newline at end of file diff --git a/client.js b/client.js index 3029864e..6409aac4 100644 --- a/client.js +++ b/client.js @@ -175,6 +175,12 @@ write-data=__PATH__executable__/../../../instances/" + instance + "\r\n\ if(instancedirectory != "./instances/undefined"){ var instanceconfig = require(instancedirectory + '/config'); instanceconfig.unique = instanceconfig.clientPassword.hashCode(); + if(process.env.FACTORIOPORT){ + instanceconfig.factorioPort = process.env.FACTORIOPORT; + } + if(process.env.RCONPORT){ + instanceconfig.rconPort = process.env.RCONPORT; + } } else { process.exit(1) }