diff --git a/templates/nakama/assets/logo.png b/templates/nakama/assets/logo.png new file mode 100644 index 000000000..18fb209b6 Binary files /dev/null and b/templates/nakama/assets/logo.png differ diff --git a/templates/nakama/assets/screenshot.png b/templates/nakama/assets/screenshot.png new file mode 100644 index 000000000..9745426e9 Binary files /dev/null and b/templates/nakama/assets/screenshot.png differ diff --git a/templates/nakama/index.ts b/templates/nakama/index.ts new file mode 100644 index 000000000..1c5083998 --- /dev/null +++ b/templates/nakama/index.ts @@ -0,0 +1,47 @@ +import { Output, randomPassword, Services } from "~templates-utils"; +import { Input } from "./meta"; + +export function generate(input: Input): Output { + const services: Services = []; + const databasePassword = randomPassword(); + const databaseAddress = `postgres:${databasePassword}@$(PROJECT_NAME)_${input.appServiceName}-db:5432/$(PROJECT_NAME)`; + + services.push({ + type: "postgres", + data: { + serviceName: `${input.appServiceName}-db`, + password: databasePassword, + }, + }); + + services.push({ + type: "app", + data: { + serviceName: input.appServiceName, + source: { + type: "image", + image: input.appServiceImage, + }, + domains: [ + { + host: "$(EASYPANEL_DOMAIN)", + port: 7351, + }, + ], + mounts: [ + { + type: "volume", + name: "data", + mountPath: "/nakama/data", + }, + ], + deploy: { + command: + `/bin/sh -ecx "/nakama/nakama migrate up --database.address ${databaseAddress} && ` + + `exec /nakama/nakama --name nakama1 --database.address ${databaseAddress} --logger.level DEBUG --session.token_expiry_sec 7200"`, + }, + }, + }); + + return { services }; +} diff --git a/templates/nakama/meta.yaml b/templates/nakama/meta.yaml new file mode 100644 index 000000000..702bcd5bd --- /dev/null +++ b/templates/nakama/meta.yaml @@ -0,0 +1,68 @@ +name: Nakama +description: + Nakama is an open-source server for social and real-time games and apps. It + provides user accounts, multiplayer, chat, leaderboards, tournaments, and + storage APIs, backed by PostgreSQL. +instructions: + After deployment, Nakama is available on your project domain at port 7351. The + template provisions a dedicated PostgreSQL service and runs Nakama database + migrations automatically before startup. +changeLog: + - date: 2026-04-29 + description: First release +links: + - label: Website + url: https://heroiclabs.com/nakama/ + - label: Documentation + url: https://heroiclabs.com/docs/nakama/ + - label: GitHub + url: https://github.com/heroiclabs/nakama +contributors: + - name: Ahson Shaikh + url: https://github.com/Ahson-Shaikh +schema: + type: object + required: + - appServiceName + - appServiceImage + properties: + appServiceName: + type: string + title: App Service Name + default: nakama + appServiceImage: + type: string + title: App Service Image + default: registry.heroiclabs.com/heroiclabs/nakama:3.22.0 +benefits: + - title: Game Backend Ready + description: + Includes core backend primitives such as accounts, sessions, storage, + chat, and multiplayer APIs with minimal setup. + - title: Built-In Database Provisioning + description: + Deploys PostgreSQL and Nakama together so you can start with a + production-style architecture quickly. + - title: Automatic Migration On Start + description: + Runs Nakama migrations before launching the main server process, reducing + manual setup work. +features: + - title: Real-Time Multiplayer Server + description: + Provides Nakama runtime for game sessions, matchmaking, social features, + and RPC endpoints. + - title: Persistent PostgreSQL Storage + description: + Stores data on a dedicated volume so database state survives restarts and + redeployments. + - title: Public Ports For API and Runtime + description: + Exposes standard Nakama ports for HTTP API, gRPC, and console-compatible + networking workflows. +tags: + - Game Server + - Realtime + - PostgreSQL + - Backend + - Multiplayer