-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (54 loc) · 2.91 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (54 loc) · 2.91 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
# syntax=docker/dockerfile:1
# ──────────────────────────────────────────────────────────────────────────────
# conflux-devkit — standalone Docker image
#
# Supported platforms: linux/amd64 (linux/arm64 coming when @xcfx/node
# publishes an arm64 linux binary)
#
# Build:
# docker build -t conflux-devkit -f docker/Dockerfile .
#
# Run:
# docker run --rm -p 7748:7748 -p 8545:8545 -p 8546:8546 \
# -p 12537:12537 -p 12535:12535 \
# -v conflux-devkit-data:/root/.conflux-devkit \
# conflux-devkit
# ──────────────────────────────────────────────────────────────────────────────
FROM node:22-slim
LABEL org.opencontainers.image.title="devkit" \
org.opencontainers.image.description="Conflux local development environment" \
org.opencontainers.image.source="https://github.com/cfxdevkit/devkit"
# Install conflux-devkit globally from npm.
# Pin to the exact version that was current when this Dockerfile was written;
# change the version to upgrade. Use --os=linux and --cpu=x64 so npm selects
# the correct @xcfx/node optional dependency even when building on macOS/ARM.
ARG DEVKIT_VERSION=1.0.10
RUN npm install -g \
--os=linux --cpu=x64 \
conflux-devkit@${DEVKIT_VERSION} \
&& npm cache clean --force
# ── Ports ──────────────────────────────────────────────────────────────────
# Web UI
EXPOSE 7748
# Conflux EVM JSON-RPC (HTTP)
EXPOSE 8545
# Conflux EVM JSON-RPC (WebSocket)
EXPOSE 8546
# Conflux Core JSON-RPC (HTTP)
EXPOSE 12537
# Conflux Core JSON-RPC (WebSocket)
EXPOSE 12535
# ── Persistent data volume ──────────────────────────────────────────────────
# Wallets and node chain data are stored under ~/.conflux-devkit.
# Mount a named volume here so data survives container restarts.
VOLUME ["/root/.conflux-devkit"]
# ── Environment variable → CLI flag mapping ─────────────────────────────────
# DEVKIT_PORT Web UI port (default: 7748)
# DEVKIT_HOST Bind address (default: 0.0.0.0)
# DEVKIT_API_KEY Bearer token for /api routes (default: unset)
# DEVKIT_CORS_ORIGIN Allowed CORS origin(s) (default: unset)
ENV DEVKIT_HOST=0.0.0.0 \
DEVKIT_PORT=7748
COPY docker/entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]