Results 1 to 10 of 11

Thread: [CoD2] Setup CoD2 with Docker

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Private Lonsofore's Avatar
    Join Date
    Oct 2016
    Posts
    86
    Thanks
    82
    Thanked 38 Times in 25 Posts
    Agree, I missed these parts. Few words about restarts:

    1. If CoD2 would stop for some reason (e.g. ShutdownGame, as Damage said) - Docker will restart it automatically ('restart' part in docker-compose.yml)
    2. If for some reason CoD2 would still run, but health check (you can look that part in Dockerfile. it's just a getinfo from the server, which takes each 5 seconds 3 times) would fail (e.g. server just freezed) - docker container would be marked as 'unhealthy'. But! In this case, the container wouldn't restart automatically - there is no such functionality in Docker. In this case you should use some tool, which would process it. For my server I use a docker image called autoheal. An example of my docker-compose.yml for autoheal:
      Code:
      version: '3.7'
        services:
          autoheal:
            image: willfarrell/autoheal
            container_name: autoheal
            restart: always
            volumes:
             - /var/run/docker.sock:/var/run/docker.sock
            environment:
             AUTOHEAL_CONTAINER_LABEL: "all"
      AUTOHEAL_CONTAINER_LABEL with value "all" means that all unhealthy containers would be restarted.

    So, your server should be up even after freeze or something like.


    About logging:
    As I said before, you always can look a full log via 'docker logs <container id>'. But if you also want to see a log file, you can find it here:
    /var/lib/docker/containers/<container id>/<container id>-json.log


    I pinned this answer to the head, in Advanced part.
    Last edited by Lonsofore; 28th February 2019 at 07:14.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •