diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c4890f9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,54 @@ +FROM golang:1.23 AS builder + +WORKDIR /app + +# Copy the Go module manifests into /app +COPY go.mod go.sum ./ + +# Download dependencies +RUN go mod download + +# Copy the entire project +COPY . . + +# Build the application using the Makefile +RUN make install + +# Use a smaller image for the final runtime container +FROM debian:bookworm-slim + +# Set up necessary environment variables +ENV MULBERRY_HOME /root/.mulberry + +# Install dependencies +RUN apt-get update && apt-get install -y \ + ca-certificates \ + wget \ + && rm -rf /var/lib/apt/lists/* + +# Download the libwasmvm.aarch64.so file directly from GitHub +WORKDIR /tmp +RUN wget https://github.com/CosmWasm/wasmvm/releases/download/v2.1.4/libwasmvm.aarch64.so \ + -O /usr/local/lib/libwasmvm.aarch64.so && \ + chmod 755 /usr/local/lib/libwasmvm.aarch64.so + +# Update the linker cache +RUN ldconfig + +# Set the working directory +WORKDIR /root/ + +# Copy the binary and configuration files from the builder +COPY --from=builder /go/bin/mulberry /usr/local/bin/mulberry +COPY --from=builder /app/config /root/.mulberry + +# Expose ports - not sure we need all of these +EXPOSE 26657 +EXPOSE 26656 +EXPOSE 26658 +EXPOSE 1317 +EXPOSE 6060 +EXPOSE 9090 + +# Command to initialize the system and start the service +CMD ["sh", "-c", "mulberry wallet address && mulberry start"] \ No newline at end of file diff --git a/Makefile b/Makefile index dd51640..53ba377 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ export GO111MODULE = on -VERSION := $(shell echo $(shell git describe --tags) | sed 's/^v//') +VERSION := $(shell (git describe --tags 2>/dev/null || echo "0.0.0") | sed 's/^v//') COMMIT := $(shell git log -1 --format='%H') ###############################################################################