I finally achieved a significant breakthrough with the Gift Grab app. I was encountering issues getting the Nakama instance to run on the server to allow users to compete against each other. It turned out that my Droplet on DigitalOcean was missing some components.
First, I had to include an extra command in my Dockerfile to fetch dependencies needed in the main.go file.
I initially ran the go mod vendor command outside the Dockerfile, so when it was deployed to the server, it couldn’t locate the packages.
Second, I discovered my Nakama instance was built from an outdated Volume. Oddly enough, if a Volume is already built, any modifications made to the Images and/or Containers are irrelevant.
FROM heroiclabs/nakama-pluginbuilder:3.16.0 AS builder
ENV GO111MODULE on
ENV CGO_ENABLED 1
WORKDIR /backend
COPY . .
RUN go mod vendor
RUN go build --trimpath --mod=vendor --buildmode=plugin -o ./backend.so
FROM heroiclabs/nakama:3.16.0
COPY --from=builder /backend/backend.so /nakama/data/modules
COPY --from=builder /backend/local.yml /nakama/data/
Once I removed everything and ran the command compose -p gift-grab-api up — build, a new Volume was built, and my leaderboard was successfully created.