diff --git a/.github/actions/docker-publish/action.yaml b/.github/actions/docker-publish/action.yaml index 49977c1..7621b70 100644 --- a/.github/actions/docker-publish/action.yaml +++ b/.github/actions/docker-publish/action.yaml @@ -61,6 +61,8 @@ runs: type=ref,event=branch type=sha,prefix= type=semver,pattern={{raw}} + flavor: | + latest=${{ github.ref == 'refs/heads/master' }} - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 6b3fb23..e28ef8f 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -19,7 +19,7 @@ jobs: runs-on: buildjet-4vcpu-ubuntu-2204 if: | (github.event_name == 'release' && github.event.action == 'published') || - github.ref == 'refs/heads/main' || github.ref == 'refs/heads/salka1988/add_ci' || github.event_name == 'pull_request' + github.ref == 'refs/heads/main' || github.ref == 'refs/heads/salka1988/add_ci' || github.event_name == 'pull_request' || github.event_name == 'push' steps: - uses: actions/checkout@v3 @@ -30,4 +30,5 @@ jobs: username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} image: ghcr.io/fuellabs/fuel-graph-node - dockerfile: fuel-graph-node/docker/Dockerfile \ No newline at end of file + dockerfile: fuel-graph-node/Dockerfile + platform: linux/amd64,linux/arm64 \ No newline at end of file diff --git a/fuel-graph-node/Dockerfile b/fuel-graph-node/Dockerfile new file mode 100644 index 0000000..81a22c0 --- /dev/null +++ b/fuel-graph-node/Dockerfile @@ -0,0 +1,55 @@ + +FROM rust:bullseye as graph-node-build + +WORKDIR /app + +RUN apt update && apt install -y protobuf-compiler +COPY ./fuel-graph-node /app/fuel-graph-node +RUN cd /app/fuel-graph-node && cargo build --release + +# The graph-node runtime image with only the executable +FROM debian:bullseye-slim as graph-node +ENV RUST_LOG "" +ENV GRAPH_LOG "" +ENV EARLY_LOG_CHUNK_SIZE "" + +ENV postgres_host "" +ENV postgres_user "" +ENV postgres_pass "" +ENV postgres_db "" +ENV postgres_args "sslmode=prefer" +# The full URL to the IPFS node +ENV ipfs "" +# The etherum network(s) to connect to. Set this to a space-separated +# list of the networks where each entry has the form NAME:URL +ENV ethereum "" +# The role the node should have, one of index-node, query-node, or +# combined-node +ENV node_role "combined-node" +# The name of this node +ENV node_id "default" +# The ethereum network polling interval (in milliseconds) +ENV ethereum_polling_interval "" + +# The location of an optional configuration file for graph-node, as +# described in ../docs/config.md +# Using a configuration file is experimental, and the file format may +# change in backwards-incompatible ways +ENV GRAPH_NODE_CONFIG "" + +# Disable core dumps; this is useful for query nodes with large caches. Set +# this to anything to disable coredumps (via 'ulimit -c 0') +ENV disable_core_dumps "" + +# HTTP port +EXPOSE 8000 +# WebSocket port +EXPOSE 8001 +# JSON-RPC port +EXPOSE 8020 +# Indexing status port +EXPOSE 8030 + +COPY --from=graph-node-build /app/fuel-graph-node/target/release/graph-node /app/graph-node + +CMD ["/app/graph-node"] diff --git a/fuel-graph-node/docker/Dockerfile b/fuel-graph-node/docker/Dockerfile index 4deac77..0044c6b 100644 --- a/fuel-graph-node/docker/Dockerfile +++ b/fuel-graph-node/docker/Dockerfile @@ -103,5 +103,5 @@ ADD docker/wait_for docker/start /usr/local/bin/ COPY --from=graph-node-build /usr/local/bin/graph-node /usr/local/bin/graphman /usr/local/bin/ COPY --from=graph-node-build /etc/image-info /etc/image-info COPY --from=envsubst /go/bin/envsubst /usr/local/bin/ -#COPY docker/Dockerfile /Dockerfile +COPY docker/Dockerfile /Dockerfile CMD ["start"]