Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi again,
i spend some time on the weekend to find a better way to centralize the generation of the config files.
Currently both
scenario.sh
anddocker-entrypoint.sh
do very similar stuff but thescenario.sh
is outdated and misses some of the improvements done indocker-entrypoint.sh
.To prevent this situation, I'd suggest to externalize the creation of the config/saves/mods folders into a script and call this from the entrypoints. So any update only needs to be done once and not in every entrypoint.
The same is valid for the start of the server, which in both cases requires the same parameters (aside from
start-server-***
which is different. Currently thescenario.sh
does not fall back to the factorio user but still executes factorio as root. Therefor I'd also suggest to use a central script here which can be called and takes care of the execution.Please have a look into the code and give feedback.
Note: I also added an optional /provisioning folder, where any configs, saves or mods can be places. Those will be loaded when the server starts. This allows us to bootstrap the server without the need of any restarts (which is very handy when running e.g. on AWS or GCP where you don't want to access the container).