mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-31 20:11:31 +02:00
* Bump go version to 1.26 and go-quic to v0.62.0 * Replace deprecated ecdsa public key assembly and add tests for jwt * Update goversioninfo * Pin go toolchain to 1.26.7
42 lines
886 B
Docker
42 lines
886 B
Docker
# Wails Server Mode Dockerfile
|
|
# Multi-stage build for minimal image size
|
|
|
|
# Build stage
|
|
FROM golang:1.26.7-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install build dependencies
|
|
RUN apk add --no-cache git
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Remove local replace directive if present (for production builds)
|
|
RUN sed -i '/^replace/d' go.mod || true
|
|
|
|
# Download dependencies
|
|
RUN go mod tidy
|
|
|
|
# Build the server binary
|
|
RUN go build -tags server -ldflags="-s -w" -o server .
|
|
|
|
# Runtime stage - minimal image
|
|
FROM gcr.io/distroless/static-debian12
|
|
|
|
# Copy the binary
|
|
COPY --from=builder /app/server /server
|
|
|
|
# Copy frontend assets
|
|
COPY --from=builder /app/frontend/dist /frontend/dist
|
|
|
|
# Expose the default port
|
|
EXPOSE 8080
|
|
|
|
# Bind to all interfaces (required for Docker)
|
|
# Can be overridden at runtime with -e WAILS_SERVER_HOST=...
|
|
ENV WAILS_SERVER_HOST=0.0.0.0
|
|
|
|
# Run the server
|
|
ENTRYPOINT ["/server"]
|