I’m trying to centralize calls from my game in nakama modules. I have been looking at the documentation and the video tutorial that they have on the web. And I’m having problems. I can launch docker compose up just fine and can access the control panel. The problem is that I can’t get the modules to appear. I have seen the documentation, I have followed the tutorial, and I have even downloaded the project that they have on github Project template nakama But there is no way to see the healthcheck in the explorer api calls. I don’t know if this has happened to anyone else. Possibly I have something misconfigured but I would say no. I have to say that I am using the cockroach database, although I don’t think that is the problem. This is my docker-compose.yml.
command: start-single-node --insecure --store=attrs=ssd,path=/var/lib/cockroach/
test: [“CMD”, “curl”, “-f”, “http://localhost:8080/health?ready=1”]
/nakama/nakama migrate up --database.address root@cockroachdb:26257 &&
exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257 --logger.level DEBUG --session.token_expiry_sec 7200 --metrics.prometheus_port 9100
test: [“CMD”, “curl”, “-f”, “http://localhost:7350/”]
entrypoint: /bin/sh -c
'sh -s < ./prometheus.yml <<EON
Do I understand correctly, that you have a problem that nakama doesn’t load your game logic modules?
do you have modules directory next to docker compose file ? If so, could you provide nakama container logs
@sergisnt what type of runtime module are you trying to load - Go, Lua or TS? If you’re using the latter, are you placing the bundled JS in the local modules folder where you have the Nakama source? The docker-compose you shared is really only meant to run Nakama with the modules present in its source code.
@sesposito My idea was to use TS types. Although I have tried projects that had Go and Lua modules and the methods do not appear either. I have used the project that you have provided. HERE and still still does not appear the modules. I have only modified the Docker Compose to use the Cockroach database. But the rest is identical. With the Index.js in the Build folder and still do not appear the methods of Daily_reward and others.
As you can see, in the project there is the daily_reward file both in TS and in GO and Lua. And it doesn’t appear in the nakama panel.
There are no modules in execution time or the methods in the API Explorer. And I have cloned the project and I have segated the steps that appear below the NPM Install and NPX TSC. I have followed the 3 tutorials they have on the web. That of Daily Reward and another more basic. What can be happening?
@sergisnt I just did docker compose up on the project template and it correctly loaded the modules, although I did not do any changes to the Docker/docker-compose.yml files in the repository, unless there’s some Windows issue I’m not aware of I don’t know why you wouldn’t see the modules being loaded too.
It also seems strange to me that I can’t see the modules or the methods created in the nakama control panel. I have followed the tutorials correctly. I have tried to disable the W10 firewall in case it had any influence but nothing. This leads me to ask myself some questions.
Is it possible that where the project is located is the problem?
Is there somewhere where the route that refers to the modules could have been configured wrong?
I have new information. I just tried on another machine and I have seen with the project from the GitHub repository if it works. BUT IT ONLY WORKS WITH POSTGRES. The problem is that when I use the cockroach docker compose that they have on their website, the default does not load the modules or the methods.
Like I explained above, you cannot use the example cockroachdb docker-compose because it is not prepared to load your local modules, you need to change the one in the project template to use the cockroach db container image instead and pass the correct db configs for Nakama to connect to it.
Just to add to what @sesposito is saying here, specifically the issue is that the “CockroachDB” Docker Compose file you are referring to runs Nakama directly from the registry.heroiclabs.com/heroiclabs/nakama:3.15.0 image. This image is not configured to load any modules from your local machine and will therefore run a vanilla Nakama server.
The Docker Compose file in the nakama-project-template repo is configured to run Nakama by building it’s own image using the provided Dockerfile. As you can see, this Dockerfile is specifically made to copy across the local module files into the Nakama container (lines 14-17).
Sorry for the delay in your response, I was away for a while. I think I now understand better how it works. So what solution do you recommend? I use the oldest version, the 3.9 that they have in the template. Or is there a way that DockerCompose version 15 can accept modules locally?
That is, I use the “docker compose up” command to launch my ‘Nakama Server’. I tried to use this project by replacing the docker-compose.yml with the one from version 15 but it doesn’t load the modules either. What would be the solution to use version 15 and generate the modules? or is it not possible for now?
Yes, my idea was to use typescript since I am more familiar with it. Now I have a question, I wanted to use the docker 3.15 image. because it is more updated than version 9. But it is not prepared to load the modules at runtime as @tom said. Is there no way to have the most updated version and have the option to load the modules? Is there any important difference between version 15 and 9? Like security for example.
I see that you want to use Cockroach instead of Postgres which seems to be the main issue here. This is just a case of replacing the postgres block in the docker-compose.yml file with an appropriate cockroach block (see the configuration here for example) and updating the database connection details in the entrypoint block for the nakama service.