jsknnr / enshrouded-server

Run Enshrouded dedicated server in a container
MIT License
203 stars 31 forks source link

Question about custom server config files #88

Open DaBomber60 opened 1 week ago

DaBomber60 commented 1 week ago

Probably a dumbass question, but I'm super green with Docker images in general

When using this run script:

sudo docker run \
  --detach \
  --name enshrouded-server \
  --mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
  --publish 15636:15636/udp \
  --publish 15637:15637/udp \
  --env=SERVER_NAME='Custom Enshrouded Server' \
  --env=SERVER_SLOTS=16 \
  --env=SERVER_PASSWORD='<password>' \
  --env=GAME_PORT=15636 \
  --env=QUERY_PORT=15637 \
  --env=EXTERNAL_CONFIG=1 \
  sknnr/enshrouded-dedicated-server:latest

Where is EXTERNAL_CONFIG=1 looking for an external config file? I tried popping an enshrouded_server.json file into the mounted volume, but it isn't being copied out of there.

Or does that env option not work with the current docker image?

criscofats commented 5 days ago

I can tell you what I did to get things working on my end.

I created an enshrouded-compose.ymloutlined below:

version: '3'
services:
  enshrouded:
    container_name: "enshrouded-server"
    restart: on-failure
    image: sknnr/enshrouded-dedicated-server:latest
    ports:
      - "15636:15636/udp"
      - "15637:15637/udp"
    environment:
      - SERVER_NAME="Server Name"
      - SERVER_PASSWORD='password'
      - GAME_PORT=15636
      - QUERY_PORT=15637
      - SERVER_SLOTS=16
      - SERVER_IP=0.0.0.0
      - EXTERNAL_CONFIG=1
    volumes:
      - enshrouded-persistent-data:/home/steam/enshrouded/savegame:Z
      - ./enshrouded_server.json:/home/steam/enshrouded/enshrouded_server.json

volumes:
  enshrouded-persistent-data:

I have the enshrouded_server.json living in the same directory I run the compose file from (I'm using podman in this) podman-compose -f enshrouded-compose.yml up -d

I'm assuming you can remove all the environment variables except for EXTERNAL_CONFIG=1 and just specify those in the json file. I also used the default enshrouded_server.json file that is autogenerated from launching the dedicated server via steam at least one time. I verified it was working by logging in with the Admin account to the server.