name: factorio
services:
  upnp:
    image: ghcr.io/vleeuwenmenno/auto-upnp:latest
    restart: unless-stopped
    network_mode: host
    environment:
      UPNP_DURATION: 86400  # 24 hours in seconds
      PORTS: | 
        [
          {"port": 34197, "protocol": "udp"}
        ]

  server-manager:
    image: "ofsm/ofsm:latest"
    container_name: "factorio-server-manager"
    restart: "unless-stopped"
    environment:
      - PUID=1000
      - PGID=1000
      - "FACTORIO_VERSION=stable"
      - "RCON_PASS=458fc84534"
    ports:
      - "5080:80"
      - "34197:34197/udp"
    volumes:
      - "./data/fsm:/opt/fsm-data"
      - "./data/saves:/opt/factorio/saves"
      - "./data/mods:/opt/factorio/mods"
      - "./data/config:/opt/factorio/config"
      - "./data/mod_packs:/opt/fsm/mod_packs"
