Nakama Deployment

Hello, I am trying to deploy Nakama in Amazon ECS and, as ECS does not support docker compose by default, Is there any way I can send the “–database.address” parameter using environment variables?

It would be something like this:
docker run --env dbaddress {{db connection string}} nakama
where dbaddress is the name of the environment variable.

Regards
Claudio

Hi, @calamas! Try to use some services on converting docker-compose file to docker run commands, like this one. After few minutes of playing with it I got this commands sequence(warning, no healthcheck, everything other is 1-per-1 as in docker-compose.yml):

docker run -v data:/var/lib/postgresql/data --name postgres -p 5432:5432 -p 8080:8080 -e POSTGRES_DB=nakama -e POSTGRES_PASSWORD=localdb postgres:12.2-alpine 
docker run -v ./:/nakama/data --name nakama --entrypoint /bin/sh -ecx /nakama/nakama migrate up --database.address postgres:localdb@postgres:5432/nakama && exec /nakama/nakama --name nakama1 --database.address postgres:localdb@postgres:5432/nakama --logger.level DEBUG --session.token_expiry_sec 7200
 --link postgres:db -p 7349:7349 -p 7350:7350 -p 7351:7351 registry.heroiclabs.com/heroiclabs/nakama:3.15.0 

Here you can see how you can pass the --database.address argument.

As for Nakama internals, it uses pgconn library to form the connection string. Which used through libpq this list of environment variables. But playing few minutes in debugging Nakama I found hardcoded host which seem currently prevents redefinition from env variables, while all used libraries allow you to do this.

Thanks for your response. I was able to do what I want generating a config.yml on build time (configuring the environment variables in my repository) and then adding --config /nakama/data/config.yml in my docker run configuration like this: