ryansheehan / terraria

Dockerfile for terraria
MIT License
291 stars 104 forks source link

added an example to run the server with compose #116

Closed aadityadhruv closed 1 year ago

aadityadhruv commented 1 year ago

This is a example to run the container with docker compose. It has some workarounds to running the container in detached mode without the server crashing.

aadityadhruv commented 1 year ago

Ah, do they work as a ENV variables? I thought they were CLI flags to pass to the entrypoint script I can change it to ENV variables if that seems like a better idea!

JRodez commented 1 year ago

There is my docker-compose.yml for example :

version: '3'

services:
  terraria:
    container_name: terraria-server
    image: ryshe/terraria:latest
    ports:
      - '7777:7777'
    restart: on-failure
    environment:
      - WORLD_FILENAME=world.wld

    volumes:
      - ~/terraria-server/config:/root/.local/share/Terraria/Worlds
    tty: true
    stdin_open: true
aadityadhruv commented 1 year ago

Done!