factoriotools / factorio-docker

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

Add an IP bind param to the entrypoint #447

Closed Dawnflash closed 1 year ago

Dawnflash commented 1 year ago

Factorio allows setting an IP address to bind to in the --bind switch. The current configuration allows setting the port, this PR also allows setting the IP using the ADDR envvar.

The behavior is as expected, setting --port 1000 --bind ::1 will bind Factorio to ::1:1000.

Why?

For example it allows restricting the IPv6 address used in server responses to allow UDP reverse proxies to work. Without such restriction the proxy may fail to recognize upstream responses due to a different IP being used for response.