Skip to content

Commit

Permalink
Merge pull request #13 from JackalLabs/docker
Browse files Browse the repository at this point in the history
feat: Docker
  • Loading branch information
BiPhan4 authored Dec 11, 2024
2 parents 4324d41 + 87fa476 commit d2a0045
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -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')

###############################################################################
Expand Down

0 comments on commit d2a0045

Please sign in to comment.