factoriotools / factorio-docker

Factorio headless server in a Docker container
https://hub.docker.com/r/factoriotools/factorio/
MIT License
926 stars 219 forks source link

host on fly.io #494

Open IslamZaoui opened 4 months ago

IslamZaoui commented 4 months ago

Is there any way to use this image on fly.io?

fisher60 commented 2 months ago

Hello, this is the source code for a docker image. I did a quick search and it appears that fly.io is a host for deploying docker images. Following their docs, you should be able to host this on fly.io.

I see the command should be: fly launch --image factoriotools/factorio:stable. This would start the hosted image for this repo with the stable version tag. I am unsure what ports/permissions fly.io will allow, so hopefully you can expose the correct ports (sometimes this may cost extra or not be available if you do not have a VPS/server with the full port range available).

miend commented 2 months ago

The tl;dr is "yes".

Quick technical correction -- while fly.io processes docker images for app deployments, they don't actually use docker (or any other container engine) on the backend for running the final product. They extract the filesystem and run it on a tiny Firecracker VM, and you have wide permissions in there.

Ports can be exposed via [[services]] in the fly.toml configuration file for your Fly app.

In this case you'd also need a dedicated IPv4 address because Fly's infra doesn't support UDP over shared IPv4s or IPv6.