Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6786547950 | |||
| 17a2caea49 | |||
| 8ff199ca10 | |||
| 62c1f3920b |
16
Dockerfile
16
Dockerfile
@@ -1,21 +1,19 @@
|
||||
# -----------------------------------------------------
|
||||
# 1. Build the Nakama plugin (ARM64)
|
||||
# 1. Build the Nakama plugin
|
||||
# -----------------------------------------------------
|
||||
FROM golang:1.22-alpine AS plugin_builder
|
||||
FROM golang:1.22 AS plugin_builder
|
||||
|
||||
# Install dependencies needed for CGO plugin build
|
||||
RUN apk add --no-cache git build-base
|
||||
RUN apt-get update && apt-get install -y \
|
||||
build-essential \
|
||||
git
|
||||
|
||||
WORKDIR /workspace
|
||||
|
||||
# Download module deps first (better caching)
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build plugin
|
||||
RUN mkdir -p build && \
|
||||
CGO_ENABLED=1 go build \
|
||||
--trimpath \
|
||||
@@ -25,9 +23,9 @@ RUN mkdir -p build && \
|
||||
|
||||
|
||||
# -----------------------------------------------------
|
||||
# 2. Build final Nakama image (ARM64)
|
||||
# 2. Build final Nakama image
|
||||
# -----------------------------------------------------
|
||||
FROM --platform=linux/arm64 heroiclabs/nakama:3.21.0 AS nakama
|
||||
FROM heroiclabs/nakama:3.21.0 AS nakama
|
||||
|
||||
# Copy plugin from builder stage
|
||||
COPY --from=plugin_builder /workspace/build/main.so /nakama/data/modules/main.so
|
||||
|
||||
Reference in New Issue
Block a user