Skip to content

Commit

Permalink
Add New Docker File (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
Salka1988 authored Apr 25, 2024
1 parent 4da6c78 commit 8fc8c38
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 11 deletions.
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ services:
build:
context: firehose
dockerfile: Dockerfile
# image: 'ghcr.io/fuellabs/fuel-subgraph:cc2be21'
# platform: linux/amd64
ports:
- "10015:10015"
- "10016:10016"
Expand Down
20 changes: 16 additions & 4 deletions firehose/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ RUN cargo chef prepare --recipe-path recipe.json
# Stage 3: Extract builder
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 --from=planner /app/recipe.json /app/
RUN cargo chef cook --release --recipe-path /app/recipe.json
COPY ./firehose-extract/ /app/
RUN cargo build --release

Expand All @@ -32,5 +32,17 @@ COPY --from=go_build /app/firehose-core/firecore /app/firecore
COPY --from=go_build /app/firehose-core/devel/standard/bootstrap.sh /app/start.sh
RUN chmod +x /app/start.sh

# Additional setup if needed
ENTRYPOINT [ "/app/start.sh" ]
# Set environment variables for port configuration
ENV FIREHOSE_PORT_1=10015
ENV FIREHOSE_PORT_2=10016
ENV FIREHOSE_PORT_3=10017
# Expose ports
EXPOSE $FIREHOSE_PORT_1
EXPOSE $FIREHOSE_PORT_2
EXPOSE $FIREHOSE_PORT_3

# Set volume
VOLUME ["/data/storage_dir"]

ENTRYPOINT ["/app/start.sh"]
CMD ["$CHAIN_ID"]
16 changes: 11 additions & 5 deletions firehose/firehose-core/devel/standard/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ set -e
FIREHOSE_EXTRACT_BIN="/app/firehose-extract"
FIREFUEL_BIN="/app/firecore"
STORAGE_DIR="/data/storage_dir"
CHAIN_ID="$1"

COMMON_LIVE_BLOCKS_ADDR="$(hostname -I | awk '{print $1}'):10024"
CHAIN_ID="${CHAIN_ID:-$1}"

COMMON_LIVE_BLOCKS_ADDR="$(hostname -I | awk '{print $1}')"

if [ -z "$CHAIN_ID" ]; then
echo "Usage: $0 CHAIN_ID"
Expand Down Expand Up @@ -38,9 +39,14 @@ start:
reader-node-path: "$FIREHOSE_EXTRACT_BIN"
reader-node-arguments: $CHAIN_ID $LAST_HEIGHT
common-live-blocks-addr: "$COMMON_LIVE_BLOCKS_ADDR"
reader-node-grpc-listen-addr: "$COMMON_LIVE_BLOCKS_ADDR"
common-live-blocks-addr: "$COMMON_LIVE_BLOCKS_ADDR:10019"
reader-node-grpc-listen-addr: "$COMMON_LIVE_BLOCKS_ADDR:10019"
# merger-grpc-listen-addr: "$COMMON_LIVE_BLOCKS_ADDR:10019"
# relayer-grpc-listen-addr: :10019
#
# merger-time-between-store-lookups: 5s
# merger-time-between-store-pruning: 10s
# merger-delete-threads: 10
END

cd "$STORAGE_DIR"
Expand Down

0 comments on commit 8fc8c38

Please sign in to comment.