Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flare-foundation/flare-p-chain-indexer
Browse files Browse the repository at this point in the history
  • Loading branch information
mboben committed Oct 12, 2023
2 parents 5fed604 + 771f604 commit b18868b
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push default image
- name: Build and push indexer container
uses: docker/build-push-action@v3.2.0
with:
context: . # Because GH actions are for kids and put protection on everything; https://stackoverflow.com/a/71159809/11276254
context: .
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ env.IMAGE_TAG }}
file: dockerfile.indexer
tags: ghcr.io/${{ github.repository }}/indexer:${{ env.IMAGE_TAG }}
- name: Build and push services container
uses: docker/build-push-action@v3.2.0
with:
context: .
push: true
file: dockerfile.services
tags: ghcr.io/${{ github.repository }}/services:${{ env.IMAGE_TAG }}
3 changes: 2 additions & 1 deletion Dockerfile → dockerfile.indexer
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ COPY . ./

# Build the applications
RUN go build -o /app/flare_indexer ./indexer/main/indexer.go
# RUN go build -o /app/flare_services ./services/main/services.go

FROM debian:latest AS execution

ARG deployment=flare
ARG type=voting

RUN apt-get -y update && apt-get -y install curl

WORKDIR /app
COPY --from=builder /app/flare_indexer .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Expand Down
27 changes: 27 additions & 0 deletions dockerfile.services
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# build executable
FROM golang:1.18 AS builder

WORKDIR /build

# Copy and download dependencies using go mod
COPY go.mod go.sum ./
RUN go mod download

# Copy the code into the container
COPY . ./

# Build the applications
RUN go build -o /app/flare_services ./services/main/services.go

FROM debian:latest AS execution

ARG deployment=flare

RUN apt-get -y update && apt-get -y install curl

WORKDIR /app
COPY --from=builder /app/flare_services .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY ./docker/indexer/config_${deployment}_services.toml ./config.toml

CMD ["./flare_services", "--config", "/app/config.toml" ]

0 comments on commit b18868b

Please sign in to comment.