Skip to content

Commit

Permalink
fix: fix build for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasmatt committed Apr 23, 2024
1 parent e895e1e commit a862592
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ coverage.txt
temp
.env

cmd/*
compounder
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM golang:1.21 AS builder

ENV GOOS=linux
# ENV GOARCH=arm64

WORKDIR /app
COPY . .
RUN rm -f go.sum
RUN go mod tidy
RUN CGO_ENABLED=0 go build -o compounder .
ENV CGO_ENABLED=0 GOOS=linux GOARCH=arm64
RUN go build -o compounder ./cmd/main.go
RUN chmod +x compounder

FROM alpine:latest
Expand Down
19 changes: 19 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package main

import (
"time"

"github.com/nibiruchain/compounder"
"github.com/nibiruchain/compounder/config"
)

func main() {
config.InitConfig()

comp := compounder.NewCompounder()
comp.ClaimRewards()

time.Sleep(10 * time.Second)

comp.Compound()
}

0 comments on commit a862592

Please sign in to comment.