Server can't find config file

I’m using Nakama 3.1.2 and deploying to the hosted service NodeChef using a Dockerfile (I don’t think they support Docker Compose).

My Dockerfile is a barely modified copy of nakama/Dockerfile at master · heroiclabs/nakama · GitHub

I’m following Docker quickstart - Nakama server but I can’t run docker commands directly, since I don’t have access to the remotely hosted machine.

The problem is I can’t figure out the relationship between files in my project folder and those on the server. No matter what file paths I use, the server can’t find the nakama-config.yml file.

I also saw this thread (and others) Server Configuration - #2 by novabyte and added VOLUME .:/nakama/data and then tried the variant VOLUME ["/nakama/data"], but it had no effect.

The config file is at the root of my project folder, alongside the Dockerfile.

“level”: “fatal”,
“ts”: “2021-03-06T20:14:15.114Z”,
“caller”: “server/config.go:77”,
“msg”: “Could not read config file”,
“path”: “/nakama/data/nakama-config.yml”,
“error”: “open /nakama/data/nakama-config.yml: no such file or directory”

I first had this problem with the server not finding the runtime js_entrypoint file, which is when I decided to try using the config file, and now here I am. :sob:

My legendary persistence has paid off!

From looking at other Dockerfiles in the repo, I discovered that the JS files needed were not being copied to the image in the original Dockerfile I used to base this on. No wonder it was looking everywhere and not finding anything!

:point_right: COPY ./build/*.js /nakama/data/modules/build/

Now my runtime code is printing “Hello World!” in the server log output.

The issue was the same for the config file.

:point_right: COPY ./nakama-config.yml /nakama/data/

And now I see the config file was loaded successfully, too.

:+1: for legendary persistence.