-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (38 loc) · 1.46 KB
/
Dockerfile
File metadata and controls
50 lines (38 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Build stage
FROM golang:1.25-alpine AS builder
RUN apk add --no-cache git
WORKDIR /build
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -ldflags "-s -w \
-X main.version=$(git describe --tags --always --dirty 2>/dev/null || echo dev) \
-X main.buildTime=$(date -u +%Y-%m-%dT%H:%M:%SZ)" \
-tags "with_quic with_utls with_wireguard with_clash_api" \
-o xboard-node ./cmd/xboard-node
# Runtime stage — sing-box & xray-core are embedded as Go libraries
FROM alpine:3.20
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /build/xboard-node /usr/local/bin/xboard-node
RUN mkdir -p /etc/xboard-node
WORKDIR /etc/xboard-node
# Config can be provided via file mount OR environment variables.
# Env var mode (no config file needed):
# docker run -d --network=host \
# -e apiHost=https://panel.example.com \
# -e apiKey=YOUR_TOKEN \
# -e nodeID=1 \
# ghcr.io/cedar2025/xboard-node:latest
#
# Supported env vars:
# apiHost / API_HOST → panel URL
# apiKey / API_KEY → server token
# nodeID / NODE_ID → node ID
# nodeType / NODE_TYPE → node type (optional)
# kernel / KERNEL_TYPE → singbox (default) or xray
# domain / DOMAIN → TLS domain (enables auto_tls)
# certFile / CERT_FILE → TLS cert path
# keyFile / KEY_FILE → TLS key path
# logLevel / LOG_LEVEL → log level
ENTRYPOINT ["xboard-node"]
CMD ["-c", "/etc/xboard-node/config.yml"]