Page 1 of 1

Factorio Docker/Rancher setup

Posted: Tue Mar 29, 2016 10:48 pm
by skord
I wrote a web UI that will install mods and handle starting/stopping/restarting your server. Also lets you download savegames and the server's entire collection of mods as a single zip file so you don't have to go hunting to make sure your local ones match. There're some basic permissions to ensure people don't go doing bad things as well. It all conveniently sits in a docker container, so it's really easy to get it working.

You can fiddle around with the image itself, or if you have Rancher installed, you can just add the git repo to the catalog and have a really easy one click install and setup of your Factorio headless server. Just go to Admin/Settings and add the git repo to your catalog: https://github.com/skord/docker_factorio.

Once you've done that, you can go to the catalog and have a one click install for the server, as shown in the attachment. I've been using it for a while now and it seems pretty stable. The container that runs your server runs a small sinatra app on port 80 that allows you to do all the stuff I said in the first paragraph.

I'd like to eventually add the option to register your server with a public server list and have the mod downloader automatically install dependencies, but I'm kinda a busy guy.
Rancher.png
Rancher.png (120.79 KiB) Viewed 5336 times

Re: Factorio Docker/Rancher setup

Posted: Thu Mar 31, 2016 10:41 pm
by onebit
If it would read the mods folder and create a zip of all the mods that would be useful.

Re: Factorio Docker/Rancher setup

Posted: Tue Apr 05, 2016 2:17 pm
by skord
onebit wrote:If it would read the mods folder and create a zip of all the mods that would be useful.
It does that on the root page, it offers a single zip of all the server's mods.

Found a few bugs I'm going to squash on a really long plane trip. One is that it prefixes the mods in a weird way (you can rename the files for now) and the other is with people who've left spaces in their mod names.

A few other enhancements to help upgrades are coming too.

Re: Factorio Docker/Rancher setup

Posted: Mon Apr 18, 2016 3:04 am
by clairaoswald
I've spent the last few hours playing with a few different docker factorio servers this evening. Experimenting with dockers on UNRAID 6. Yours seems to be the only server with a web interface allowing access inside of the docker.

Great solutions so far. Thanks for your time spent.



I have a couple of questions?

Does the loading of mods actually work? I get an "Internal Server Error".

I specified the saves path to a local folder on my server. /opt/factorio/saves <-=>/mnt/cache/appdata/Factorio/server2/
This seems to work great.

Is there a workaround for mods? A path that should be set for the mods?
Just tried /opt/factorio/mods <-> /mnt/cache/appdata/Factorio/server2/mods/
This works great, auto loads everything I put in the folder.

I really like that I can stop and start the server. Allows the manual switching of savegame files.

Any chance of pushing out a 0.12.30 version? I cant open my save on 0.12.29.

I was wondering how I can go about changing server variables that are set during startup. commands described here: viewtopic.php?f=53&t=15420

Image

Re: Factorio Docker/Rancher setup

Posted: Tue May 10, 2016 11:43 pm
by skord
clairaoswald wrote: Does the loading of mods actually work? I get an "Internal Server Error".
Yeah, this. So I have to spend a hot minute on this. I have a server up with a few mods, but what I've noticed is that if there is a space in the filename, that you get the html escape character in the file name rather than the actual file name for one.

The other is that it's extremely hacky to download mods from the forums, there's all sorts of redirects, the filename isn't presented from the URL in a sane way, and it's just a general pain in the ass if you're downloading from the forums. If you're downloading tagged releases from github, I've not run across a problem yet.
clairaoswald wrote: I specified the saves path to a local folder on my server. /opt/factorio/saves <-=>/mnt/cache/appdata/Factorio/server2/
This seems to work great.
Yup, if you're using rancher, this is actually how the save is persisted in a volume container. You figured it out.
clairaoswald wrote: Is there a workaround for mods? A path that should be set for the mods?
Just tried /opt/factorio/mods <-> /mnt/cache/appdata/Factorio/server2/mods/
This works great, auto loads everything I put in the folder.
Sure, that works. You could do something like setup a volume container for this guy too so the mods are persistent across server upgrades. I can't remember if I've done that or not, mental note, I need to.
clairaoswald wrote: Any chance of pushing out a 0.12.30 version? I cant open my save on 0.12.29.

Sorry about the lapse there, life took over. 0.12.33 is published to docker hub. There's a tag for 0.12.30, but it's failsauce.
clairaoswald wrote: I was wondering how I can go about changing server variables that are set during startup. commands described here: viewtopic.php?f=53&t=15420
So for ease of use, I threw the web UI into the docker container, which was really poor planning on my part. I should have created a vanilla docker container with factorio and linked the WebUI into it. So instead of being able to modify the COMMAND or ENTRYPOINT, you have to build it yourself and modify the factorio_runit.sh file. Well, modify it then build it.

I'd really like to see some sort of consistent API for grabbing mods. Even if it's using some sort of normative in github search. Using the factoriomods site has inconsistent results, and scraping the forums just really sucks as an alternative. Until we can all agree on something here, it makes it painful to write any thing on top of factorio headless while providing features such as mods.