Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,9 @@ FROM golang:1.24-alpine AS builder

RUN apk update && apk add --no-cache make bash nodejs npm

# Wallet-specific build configuration
# Default: / (for simple-stack deployment with direct port access)
ARG VITE_WALLET_BASE_PATH=/
ARG VITE_EXPLORER_BASE_PATH=http://localhost:50001
# RPC proxy targets for chain.json generation
ARG VITE_WALLET_RPC_PROXY_TARGET=http://localhost:50002
ARG VITE_WALLET_ADMIN_RPC_PROXY_TARGET=http://localhost:50003
ARG VITE_ROOT_WALLET_RPC_PROXY_TARGET=http://localhost:50002


WORKDIR /go/src/github.com/canopy-network/canopy
COPY . /go/src/github.com/canopy-network/canopy

# Export build configuration to environment
ENV VITE_WALLET_BASE_PATH=${VITE_WALLET_BASE_PATH}
ENV VITE_EXPLORER_BASE_PATH=${VITE_EXPLORER_BASE_PATH}
ENV VITE_WALLET_RPC_PROXY_TARGET=${VITE_WALLET_RPC_PROXY_TARGET}
ENV VITE_WALLET_ADMIN_RPC_PROXY_TARGET=${VITE_WALLET_ADMIN_RPC_PROXY_TARGET}
ENV VITE_ROOT_WALLET_RPC_PROXY_TARGET=${VITE_ROOT_WALLET_RPC_PROXY_TARGET}


RUN make build/wallet
RUN make build/explorer
Expand Down
62 changes: 62 additions & 0 deletions .docker/auto-update/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM node:24-alpine AS builder

ARG BRANCH='latest'
ARG CLI_DIR
ARG BUILD_PATH=cmd/cli
ARG GO_BIN_DIR
ARG BUILD_LOCAL=False
ARG BIN_PATH=/bin/cli

# downloads git and clones selected version
RUN apk add --no-cache git ca-certificates alpine-sdk
WORKDIR /go/src/github.com/canopy-network/canopy
RUN echo "Building from BRANCH=${BRANCH}" && \
if [ "$BRANCH" = "latest" ]; then \
echo "Fetching latest tag..."; \
git clone https://github.com/canopy-network/canopy.git . && \
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \
echo "Checking out tag $LATEST_TAG" && \
git checkout $LATEST_TAG; \
else \
echo "Cloning branch $BRANCH" && \
git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \
fi
# copy golang
COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"

RUN go version
# Builds
RUN apk update && apk add --no-cache make bash nodejs npm
RUN make build/wallet
RUN make build/explorer

# Builds auto-update CLI
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/.

# Only build if the file at ${BIN_PATH} doesn't already exist
RUN if [ ! -f "${BIN_PATH}" ]; then \
echo "File ${BIN_PATH} not found. Building it..."; \
CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/...; \
else \
echo "File ${BIN_PATH} already exists. Skipping build."; \
fi

FROM alpine:3.23
WORKDIR /app
ARG BIN_PATH=/bin/cli

# Coying for command
COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy
# Copying cli for auto update
COPY --from=builder ${BIN_PATH} ${BIN_PATH}
# Copying entrypoint for persisting update cli
COPY entrypoint.sh /app/entrypoint.sh

RUN apk add --no-cache pigz ca-certificates

RUN chmod +x ${BIN_PATH}
RUN chmod +x /app/canopy
RUN chmod +x /app/entrypoint.sh

ENTRYPOINT ["/app/entrypoint.sh"]
82 changes: 82 additions & 0 deletions .docker/auto-update/Dockerfile.csharp
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
FROM node:24-alpine AS builder

ARG BRANCH='latest'
ARG BIN_PATH=/bin/cli

# Install build dependencies
RUN apk add --no-cache git ca-certificates alpine-sdk

WORKDIR /go/src/github.com/canopy-network/canopy

# Clone repository
RUN echo "Building from BRANCH=${BRANCH}" && \
if [ "$BRANCH" = "latest" ]; then \
echo "Fetching latest tag..."; \
git clone https://github.com/canopy-network/canopy.git . && \
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \
echo "Checking out tag $LATEST_TAG" && \
git checkout $LATEST_TAG; \
else \
echo "Cloning branch $BRANCH" && \
git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \
fi

# Copy golang
COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"

RUN go version

# Install build tools
RUN apk update && apk add --no-cache make bash nodejs npm

# Build wallet and explorer
RUN make build/wallet
RUN make build/explorer

# Build auto-update coordinator
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/.

# Build CLI
RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/...

# =============================================================================
# Final image for C# plugin
# =============================================================================
# Using Alpine base since C# plugin is now self-contained (includes .NET runtime)
FROM alpine:3.23
WORKDIR /app
ARG BIN_PATH=/bin/cli

# Install runtime dependencies
# - bash: required for pluginctl.sh scripts
# - procps: provides pkill for plugin process cleanup
# - ca-certificates: for HTTPS requests to GitHub API
# - pigz: for fast tarball extraction
# - libstdc++, libgcc, icu-libs: required by .NET self-contained apps on Alpine
RUN apk add --no-cache bash procps ca-certificates pigz libstdc++ libgcc icu-libs

# Copy auto-update coordinator binary
COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy

# Copy CLI binary
COPY --from=builder ${BIN_PATH} ${BIN_PATH}

# Create plugin directory and copy only pluginctl.sh
# Self-contained plugin binary will be downloaded from upstream release and extracted on first start
RUN mkdir -p /app/plugin/csharp/bin
COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/csharp/pluginctl.sh /app/plugin/csharp/pluginctl.sh

# Copy entrypoint
COPY entrypoint.sh /app/entrypoint.sh

# Set permissions
RUN chmod +x ${BIN_PATH} && \
chmod +x /app/canopy && \
chmod +x /app/entrypoint.sh && \
chmod +x /app/plugin/csharp/pluginctl.sh

# Create plugin temp directory
RUN mkdir -p /tmp/plugin

ENTRYPOINT ["/app/entrypoint.sh"]
80 changes: 80 additions & 0 deletions .docker/auto-update/Dockerfile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM node:24-alpine AS builder

ARG BRANCH='latest'
ARG BIN_PATH=/bin/cli

# Install build dependencies
RUN apk add --no-cache git ca-certificates alpine-sdk

WORKDIR /go/src/github.com/canopy-network/canopy

# Clone repository
RUN echo "Building from BRANCH=${BRANCH}" && \
if [ "$BRANCH" = "latest" ]; then \
echo "Fetching latest tag..."; \
git clone https://github.com/canopy-network/canopy.git . && \
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \
echo "Checking out tag $LATEST_TAG" && \
git checkout $LATEST_TAG; \
else \
echo "Cloning branch $BRANCH" && \
git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \
fi

# Copy golang
COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"

RUN go version

# Install build tools
RUN apk update && apk add --no-cache make bash nodejs npm

# Build wallet and explorer
RUN make build/wallet
RUN make build/explorer

# Build auto-update coordinator
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/.

# Build CLI
RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/...

# =============================================================================
# Final image for Go plugin
# =============================================================================
FROM alpine:3.23
WORKDIR /app
ARG BIN_PATH=/bin/cli

# Install runtime dependencies
# - bash: required for pluginctl.sh scripts
# - procps: provides pkill for plugin process cleanup
# - ca-certificates: for HTTPS requests to GitHub API
# - pigz: for fast tarball extraction
RUN apk add --no-cache bash procps ca-certificates pigz

# Copy auto-update coordinator binary
COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy

# Copy CLI binary
COPY --from=builder ${BIN_PATH} ${BIN_PATH}

# Create plugin directory and copy only pluginctl.sh
# Plugin binary will be downloaded from upstream release and extracted on first start
RUN mkdir -p /app/plugin/go
COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/go/pluginctl.sh /app/plugin/go/pluginctl.sh

# Copy entrypoint
COPY entrypoint.sh /app/entrypoint.sh

# Set permissions
RUN chmod +x ${BIN_PATH} && \
chmod +x /app/canopy && \
chmod +x /app/entrypoint.sh && \
chmod +x /app/plugin/go/pluginctl.sh

# Create plugin temp directory
RUN mkdir -p /tmp/plugin

ENTRYPOINT ["/app/entrypoint.sh"]
81 changes: 81 additions & 0 deletions .docker/auto-update/Dockerfile.kotlin
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
FROM node:24-alpine AS builder

ARG BRANCH='latest'
ARG BIN_PATH=/bin/cli

# Install build dependencies
RUN apk add --no-cache git ca-certificates alpine-sdk

WORKDIR /go/src/github.com/canopy-network/canopy

# Clone repository
RUN echo "Building from BRANCH=${BRANCH}" && \
if [ "$BRANCH" = "latest" ]; then \
echo "Fetching latest tag..."; \
git clone https://github.com/canopy-network/canopy.git . && \
LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) && \
echo "Checking out tag $LATEST_TAG" && \
git checkout $LATEST_TAG; \
else \
echo "Cloning branch $BRANCH" && \
git clone -b "$BRANCH" https://github.com/canopy-network/canopy.git .; \
fi

# Copy golang
COPY --from=golang:1.24-alpine /usr/local/go/ /usr/local/go/
ENV PATH="/usr/local/go/bin:${PATH}"

RUN go version

# Install build tools
RUN apk update && apk add --no-cache make bash nodejs npm

# Build wallet and explorer
RUN make build/wallet
RUN make build/explorer

# Build auto-update coordinator
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin ./cmd/auto-update/.

# Build CLI
RUN CGO_ENABLED=0 GOOS=linux go build -a -o "${BIN_PATH}" ./cmd/main/...

# =============================================================================
# Final image for Kotlin plugin
# =============================================================================
FROM alpine:3.23
WORKDIR /app
ARG BIN_PATH=/bin/cli

# Install runtime dependencies
# - bash: required for pluginctl.sh scripts
# - openjdk21-jre: Java runtime for Kotlin plugin
# - procps: provides pkill for plugin process cleanup
# - ca-certificates: for HTTPS requests to GitHub API
# - pigz: for fast tarball extraction
RUN apk add --no-cache bash openjdk21-jre procps ca-certificates pigz

# Copy auto-update coordinator binary
COPY --from=builder /go/src/github.com/canopy-network/canopy/bin ./canopy

# Copy CLI binary
COPY --from=builder ${BIN_PATH} ${BIN_PATH}

# Create plugin directory and copy only pluginctl.sh
# Plugin JAR will be downloaded from upstream release and extracted on first start
RUN mkdir -p /app/plugin/kotlin/build/libs
COPY --from=builder /go/src/github.com/canopy-network/canopy/plugin/kotlin/pluginctl.sh /app/plugin/kotlin/pluginctl.sh

# Copy entrypoint
COPY entrypoint.sh /app/entrypoint.sh

# Set permissions
RUN chmod +x ${BIN_PATH} && \
chmod +x /app/canopy && \
chmod +x /app/entrypoint.sh && \
chmod +x /app/plugin/kotlin/pluginctl.sh

# Create plugin temp directory
RUN mkdir -p /tmp/plugin

ENTRYPOINT ["/app/entrypoint.sh"]
Loading
Loading