Skip to content

Commit

Permalink
add action
Browse files Browse the repository at this point in the history
  • Loading branch information
Salka1988 committed Apr 22, 2024
1 parent 555f902 commit bf3a41e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ services:
firehose:
build:
context: firehose
dockerfile: Dockerfile
ports:
- "10015:10015"
- "10016:10016"
Expand Down
20 changes: 11 additions & 9 deletions firehose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,33 @@ WORKDIR /app

## Planner stage
FROM chef AS planner
COPY ./firehose-extract/ ./firehose-extract/
COPY firehose-extract/ /app/
RUN cargo chef prepare --recipe-path recipe.json

# Extract builder stage
FROM chef AS extract_builder
RUN apt update && apt install -y protobuf-compiler
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY ./firehose-extract/ ./firehose-extract/
COPY firehose-extract/ /app/
RUN cargo build --release

FROM golang:1.22-alpine as go_build
COPY ./firehose-core/ ./firehose-core/
COPY ./substreams/ ./substreams/
WORKDIR firehose-core
COPY firehose-core/ /app/firehose-core/
COPY substreams/ /app/substreams/
WORKDIR /app/firehose-core
RUN go mod download
ARG VERSION="dev"
RUN apk --no-cache add git
RUN go build -v -ldflags "-X main.version=${VERSION}" -o /firehose-core/firecore ./cmd/firecore
RUN go build -v -ldflags "-X main.version=${VERSION}" -o /app/firehose-core/firecore ./cmd/firecore

# Final stage
FROM debian
COPY --from=extract_builder /app/target/release/firehose-extract ./app/firehose-extract
COPY --from=go_build /firehose-core/firecore ./app/firecore
COPY ./firehose-core/devel/standard/bootstrap.sh /app/start.sh
COPY --from=extract_builder /app/target/release/firehose-extract /app/firehose-extract
COPY --from=go_build /app/firehose-core/firecore /app/firecore

COPY firehose-core/devel/standard/bootstrap.sh /app/start.sh

RUN chmod +x /app/start.sh

# Additional setup if needed
Expand Down

0 comments on commit bf3a41e

Please sign in to comment.