Develop and deploy Go modules

We’ve developed our game using go modules on windows, using docker method (through the use of pluginbuilder). The modules are compiled into a directory, and this directory is then passed to the docker run command (the windows disk/data path is bound in yml). We are now trying to deploy this in production (Linux). The recommended method is to use the binary install method. How do we pass the information about our go modules to the nakama binary using this method?

Good question.

Nakama loads the shared object file compiled with the Go compiler - it doesn’t compile your Go code for you.

You’ll need to compile your Go module into a Shared Object using go build --buildmode=plugin - this produces a .so file - then you can point Nakama to the folder that has this file (and other Lua files) using --runtime.path config option.

Steps what we are going to follow.

step1 : Install docker,docker-compose on live server
step2 : Install nakama using docker on live
step3 : upload project on live
then make a .so file using plugin builder
onLast point nakama to the project folder (.so parent folder)

@HashtagGo You should not use docker-compose to run your production setup. It’s not designed for that purpose and I strongly recommend against it because you might incur data loss. Have you looked at our Managed Cloud or the steps to run on the Digital Ocean marketplace?

we should look your managed Cloud service must , having a confusion we have a micro service which must running in same server that is developed in node.js

Why is that? Because of missing backups (if he doesn’t have any). Btw, what data would be needed to be backed up? Is everything stored in the database or is there more?

@dertom There’s a few different reasons not to deploy with docker-compose.

  1. You’ll run both the server and the database server containers on the same hardware without resource limits which will cause them to compete for CPU and RAM. i.e. It will hurt performance.
  2. Unless you’ve created special configuration for your Docker volumes you’ll have your storage data be setup inside the container as a virtual volume. This makes it much harder to access and create incremental snapshots for backups. It’s doable but not without extra knowledge to setup and maintain it.

Is everything stored in the database or is there more?

We store all core data in the database but the game server maintains in-memory indexes for most of the realtime features. These datasets are recreated over the course of server startup and while client devices connect with a socket.

1 Like