Skip to content

Commit

Permalink
Docker file added; (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
mismirnov authored Jan 17, 2025
1 parent 58e875f commit 750982f
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,22 @@ jobs:
cache-to: type=gha,mode=max
tags: ${{ steps.meta-quotes.outputs.tags }}
labels: ${{ steps.meta-quotes.outputs.labels }}

# Tvl

- name: Tvl image tags & labels
id: meta-tvl
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_BASE }}-tvl

- name: Tvl image build & push
uses: docker/build-push-action@v5
with:
context: .
file: build/tvl/Dockerfile
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta-tvl.outputs.tags }}
labels: ${{ steps.meta-tvl.outputs.labels }}
37 changes: 37 additions & 0 deletions build/tvl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# ---------------------------------------------------------------------
# The first stage container, for building the application
# ---------------------------------------------------------------------
FROM golang:1.23.2-alpine AS builder

ENV CGO_ENABLED=0
ENV GO111MODULE=on
ENV GOOS=linux

RUN apk --no-cache add ca-certificates

RUN mkdir -p $GOPATH/src/github.com/celenium-io/celestia-indexer/

COPY ./go.* $GOPATH/src/github.com/celenium-io/celestia-indexer/
WORKDIR $GOPATH/src/github.com/celenium-io/celestia-indexer
RUN go mod download

COPY cmd/tvl cmd/tvl
COPY internal internal
COPY pkg pkg

WORKDIR $GOPATH/src/github.com/celenium-io/celestia-indexer/cmd/tvl/
RUN go build -a -o /go/bin/tvl .

# ---------------------------------------------------------------------
# The second stage container, for running the application
# ---------------------------------------------------------------------
FROM scratch

WORKDIR /app/celestia-indexer/

COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /go/bin/tvl /go/bin/tvl
COPY configs/dipdup.yml ./
COPY database database

ENTRYPOINT ["/go/bin/tvl", "-c", "dipdup.yml"]

0 comments on commit 750982f

Please sign in to comment.