Hi, I was able to create a droplet in DigitalOcean and deploy the Nakama server successfully, Now I am trying to create a DigitalOcean App instead of a Droplet to make use of auto-scaling and CI/CD.
I get the following error related to DB. Not sure how to solve it.
{"level":"fatal","ts":"2023-12-08T09:53:38.100Z","caller":"server/db.go:86","msg":"Error pinging database","error":"failed to connect to `host=localhost user=root database=nakama`: dial error (dial tcp [::1]:26257: connect: connection refused)"}
Here is my docker-compose file
version: '3'
services:
postgres:
command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all
environment:
- POSTGRES_DB=nakama
- POSTGRES_PASSWORD=localdb
expose:
- "8080"
- "5432"
image: postgres:12.2-alpine
ports:
- "5432:5432"
- "8080:8080"
volumes:
- data:/var/lib/postgresql/data
nakama:
build: .
depends_on:
- postgres
entrypoint:
- "/bin/sh"
- "-ecx"
- >
/nakama/nakama migrate up --database.address postgres:localdb@postgres:5432/nakama &&
exec /nakama/nakama --config /nakama/data/local.yml --database.address postgres:localdb@postgres:5432/nakama
expose:
- "7349"
- "7350"
- "7351"
healthcheck:
test: ["CMD", "/nakama/nakama", "healthcheck"]
interval: 10s
timeout: 5s
retries: 5
links:
- "postgres:db"
ports:
- "7349:7349"
- "7350:7350"
- "7351:7351"
restart: unless-stopped
volumes:
data: