beeta/nakama/Dockerfile

36 lines
1.1 KiB
Text
Raw Permalink Normal View History

# =============================================================================
2026-01-08 00:52:34 -05:00
# Nakama with Custom Go Chess Modules
# =============================================================================
# Two-stage build:
2026-01-08 00:52:34 -05:00
# 1. Build Go plugin using official Nakama plugin builder
# 2. Copy compiled plugin to Nakama runtime
# =============================================================================
2026-01-08 00:52:34 -05:00
# Stage 1: Build Go plugin
# IMPORTANT: Plugin builder version MUST match Nakama server version
FROM heroiclabs/nakama-pluginbuilder:3.35.1 AS builder
2026-01-08 00:52:34 -05:00
WORKDIR /backend
2026-01-08 00:58:21 -05:00
# Copy Go module files and source
2026-01-08 00:52:34 -05:00
COPY go-modules/go.mod go-modules/go.sum* ./
COPY go-modules/*.go ./
2026-01-08 00:58:21 -05:00
# Generate go.sum and download dependencies
RUN go mod tidy
2026-01-08 00:52:34 -05:00
# Build the plugin as a shared library
RUN go build -buildmode=plugin -trimpath -o backend.so .
2026-01-08 01:52:14 -05:00
# Verify build exists
RUN ls -la backend.so
2026-01-08 00:52:34 -05:00
# Stage 2: Nakama runtime with Go plugin
2026-01-07 22:20:16 -05:00
FROM registry.heroiclabs.com/heroiclabs/nakama:3.35.1
2026-01-08 00:52:34 -05:00
# Copy compiled Go plugin
COPY --from=builder /backend/backend.so /nakama/data/modules/backend.so
2026-01-08 00:52:34 -05:00
# Copy config file
COPY config.yml /nakama/data/config.yml