ryansheehan / terraria

Dockerfile for terraria
MIT License
291 stars 104 forks source link

Can't find logfile for fail2ban setup #153

Open herms123 opened 1 year ago

herms123 commented 1 year ago

Thank you for your work maintaining the images!

I am trying to save the server logs to the host to setup fail2ban.

A separate directory can be volumed in for storing logs outside of the image

The logs inside the container seems to be empty. Mapping it to host creates an empty log folder.

Am I missing something?

Full docker-compose file

version: "3"

services:

  terraria:
      image: ryshe/terraria:vanilla-latest
      container_name: terraria
      ports:
        - "7777:7777"
      volumes:
        - ./world:/root/.local/share/Terraria/Worlds
        - ./logs:/terraria-server/logs
      environment:
        - WORLD_FILENAME=gangleton.wld
        - CONFIGPATH=/config
        - CONFIG_FILENAME=serverconfig.txt
        - TZ=Africa/Johannesburg
        - LOGPATH=/terraria-server/logs
      logging:
        options:
          max-size: "200k"
      restart: always
      tty: true
      stdin_open: true

I have tried changing the Env Logpath but still only shows blank logs folder.

I have come across this proposed workaround in a forum post but I think that will only work if Terraria is not running on docker? ./terraria | tee -a terraria.log