maxsupermanhd / FactoCord-3.0

Factorio bidirectional Discord bridge bot for Linux servers with control functionality.
Apache License 2.0
14 stars 10 forks source link

How about a docker image with a headless server? #48

Closed ZCube closed 1 year ago

ZCube commented 1 year ago

I think it will be more convenient to use if it is packaged and distributed with Docker.

https://github.com/ZCube/FactoCord-3.0/commit/eeda51aacb3a1b46b655ba264807eb59da1601ad

version: '3.5'

services:
  factorio:
    image: ghcr.io/zcube/factocord-3.0:feature-docker
    restart: unless-stopped
    ports:
     - "${PORT:-34197}:${PORT:-34197}/udp"
     - "27015:27015/tcp"
    volumes:
     - /etc/localtime:/etc/localtime:ro
     - ./factorio:/factorio
    environment:
      - PORT=${PORT:-34197}
      - TZ=UTC
      - DISCORD_TOKEN=secret_token
      - FACTORIO_CHANNEL_ID=id
maxsupermanhd commented 1 year ago

I am not a docker expert and don't want to take responsibility for non-working docker setup, perhaps @TechnoStrife can evaluate this?

TechnoStrife commented 1 year ago

Could you please elaborate on how exactly is it going to help in packaging and distribution? I'm not opposed to this, but for me the current approach seems like a simple process: download factocord executable, download factorio server, edit the config and run.

Also I have a few questions to your approach in creating an image:

  1. Why do you build an image with a specific factorio version? We obviously are not going to build an image for every single factorio version, so how would an end user update the factorio server or install another version (other than latest)?
  2. Why do you suggest removing some settings from the config file and getting them from the environement variables?
maxsupermanhd commented 1 year ago

He did not strictly remove settings from config but instead tries to locate it in env or filesystem if they are empty, I am not against environment part but very much against filesystem approach. If you are reaching to filesystem you might just edit the config, it is like parsing second config if first one is not complete or something...

I also do not understand complete reason of packaging stuff into docker, perhaps for some very very specific hosting provider?

Whole idea with docker seems like an extra step in already as simple as it gets procedure, like writing two config files instead of one. I would understand appeal in ability to package/backup/restore a complete instance but that seems like an overcomplication since you can just back up one file - save (also btrfs and tar exists...).

PS just a reminder that in the first place it is a wrapper for the Factorio executable, not a server manager or control panel even if it has such functionality. You can not upload/download saves nor change Factorio version through FactoCord (perhaps we could but that's likely outside of the scope of the project, there are better tools for that).

TechnoStrife commented 1 year ago

Also the config file exists to be edited, not to be packed into an image and then overriden by other files and environment variables

ZCube commented 1 year ago

I wanted this FactoCord to work on my kubernetes cluster. I'm closing this issue as many of these changes are either Docker-friendly or specific to kubernetes.

https://github.com/ZCube/factorio-server-charts