ZCube / factorio-port-fixer

for Factorio headless server.
MIT License
3 stars 0 forks source link
docker factorio server

factorio-port-fixer

Matching Server Port fixer

Usage

Example

version: '3.5'

services:
  pingpong:
    image: ghcr.io/zcube/factorio-port-fixer:main
    command: /factorio-port-fixer local --ip=0.0.0.0 --port=34197 --remotePort=${PORT:-34197}
    restart: unless-stopped
    environment:
      - PORT=${PORT:-34197}
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
    healthcheck:
      test: curl --fail 127.0.0.1:34197/health || exit 1
      interval: 20s
      retries: 5
      start_period: 20s
      timeout: 10s

  factorio:
    image: factoriotools/factorio:stable
    restart: unless-stopped
    environment:
      - PORT=${PORT:-34197}
      - TZ=UTC
      - TOKEN=${TOKEN}
    ports:
      - "${PORT:-34197}:${PORT:-34197}/udp"
      - "27015:27015/tcp"
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - ./factorio:/factorio

    links:
      - "pingpong:pingpong1.factorio.com"
      - "pingpong:pingpong2.factorio.com"
      - "pingpong:pingpong3.factorio.com"
      - "pingpong:pingpong4.factorio.com"
    healthcheck:
      test: curl --fail pingpong:34197/health_for_factorio || exit 1
      interval: 20s
      retries: 5
      start_period: 20s
      timeout: 10s
version: '3.5'

services:
  factorio:
    image: factoriotools/factorio
    restart: unless-stopped
    ports:
     - "34197:34197/udp"
     - "27015:27015/tcp"
    volumes:
     - /etc/localtime:/etc/localtime:ro
     - ./factorio:/factorio
    environment:
     - TZ=UTC
    # sample server on oci remote port 34197 fixed
    extra_hosts:
     - 'pingpong1.factorio.com:144.24.94.63'
     - 'pingpong2.factorio.com:144.24.94.63'
     - 'pingpong3.factorio.com:144.24.94.63'
     - 'pingpong4.factorio.com:144.24.94.63'
    healthcheck:
      test: curl --fail 144.24.94.63:34197/health_for_factorio || exit 1
      interval: 20s
      retries: 5
      start_period: 20s
      timeout: 10s

MIT License

Copyright (c) 2023 ZCube

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.