Server Configuration

Hi @Mohammed. Welcome :wave:

There’s two ways to achieve what you want to do:

  1. You can edit the start line for the server in your Docker Compose file so it includes your desired token lifetime as part of the command flags:

    nakama --logger.level DEBUG --session.token_expiry_sec 7200
    

    Have a look at one of our official Docker Compose files for an example on how to set it:

    https://github.com/heroiclabs/nakama/blob/master/docker-compose-postgres.yml#L23-L24

  2. You could mount a virtual filesystem so that your YML configuration is available inside the container filesystem to be read by Nakama at startup. I think this is the approach you’ve tried so far. With our standard Docker Compose files this should work:

    1. Make sure there’s a volume mount for the local filesystem into the container.

      volumes:
        - ./:/nakama/data
      

      This will take your current work directory and mount it inside the container to the folder path “/nakama/data”. I’ll assume that in your current work directory you’d have a config.yml file with Nakama server configuration values.

    2. Adjust the start command in the Docker Compose file for the server to look for your YML file.

      nakama --config "/nakama/data/config.yml"
      

Hope that helps.

2 Likes