forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.mio
More file actions
88 lines (71 loc) · 2.71 KB
/
Dockerfile.mio
File metadata and controls
88 lines (71 loc) · 2.71 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# --------------------------------------------
# WorldLand Mio Testnet Node Dockerfile
# --------------------------------------------
# This specialized Dockerfile builds and runs a WorldLand node
# preconfigured for the Mio testnet network.
# --------------------------------------------
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
# --------------------------------------------
# Stage 1: Build WorldLand binaries in a Go builder container
# --------------------------------------------
FROM golang:1.24-alpine AS builder
# Install required build tools
RUN apk add --no-cache gcc musl-dev linux-headers git
# Set working directory
WORKDIR /worldland
# Copy Go module files and download dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy the full project source
COPY . .
# Build the WorldLand binary (statically linked)
RUN go run build/ci.go install -static ./cmd/worldland
# --------------------------------------------
# Stage 2: Create a minimal runtime container with the built binary
# --------------------------------------------
FROM alpine:latest
# Install runtime dependencies
RUN apk add --no-cache ca-certificates curl jq
# Create data directory for blockchain data
RUN mkdir -p /worldland/data
# Copy the compiled worldland binary
COPY --from=builder /worldland/build/bin/worldland /usr/local/bin/
# Expose standard blockchain ports
# 8545: HTTP-RPC server
# 8546: WS-RPC server
# 30303: P2P network (TCP & UDP)
EXPOSE 8545 8546 30303 30303/udp
# Set data directory as volume
VOLUME ["/worldland/data"]
# Default entrypoint runs worldland with Mio testnet flag
# Users can override CMD to add additional flags
ENTRYPOINT ["worldland"]
# Default command runs Mio testnet with common settings
# --mio: Use Mio testnet network
# --datadir: Store blockchain data in /worldland/data
# --http: Enable HTTP-RPC server
# --http.addr: Listen on all interfaces
# --http.corsdomain: Allow CORS from any origin (adjust for production)
# --http.vhosts: Allow any virtual host (adjust for production)
CMD ["--mio", \
"--datadir", "/worldland/data", \
"--http", \
"--http.addr", "0.0.0.0", \
"--http.api", "eth,net,web3,txpool", \
"--http.corsdomain", "*", \
"--http.vhosts", "*"]
# --------------------------------------------
# Metadata labels for programmatic image tracking
# --------------------------------------------
ARG COMMIT=""
ARG VERSION=""
ARG BUILDNUM=""
LABEL org.opencontainers.image.title="WorldLand Mio Testnet Node"
LABEL org.opencontainers.image.description="WorldLand blockchain node for Mio testnet network"
LABEL org.opencontainers.image.source="https://github.com/cryptoecc/WorldLand"
LABEL commit="$COMMIT"
LABEL version="$VERSION"
LABEL buildnum="$BUILDNUM"
LABEL network="mio-testnet"