Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add New Docker File #48

Merged
merged 1 commit into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
rfuelsh marked this conversation as resolved.
Show resolved Hide resolved
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
Loading