Skip to content

Commit

Permalink
create entrypoint script for secrets compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
dshiell committed Aug 7, 2024
1 parent 071d9a0 commit ad95186
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ RUN apk update && apk add --no-cache \
# openssl?

COPY --from=builder /app/target/release/cached-eth-rpc /app/cached-eth-rpc
COPY --from=builder /app/entrypoint.sh /app/entrypoint.sh

ENV ENDPOINTS="eth-chain=https://rpc.ankr.com/eth,bsc-chain=https://rpc.ankr.com/bsc"

EXPOSE 8124
ENTRYPOINT [ "/app/cached-eth-rpc" ]
17 changes: 17 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

# Ensure the script exits if any command fails
set -e

# Check if required environment variables are set
if [ -z "$ETH_SEPOLIA" ] || [ -z "$OP_SEPOLIA" ] || [ -z "$BASE_SEPOLIA" ]; then
echo "Error: One or more required environment variables are not set."
echo "Please set ETH_SEPOLIA, OP_SEPOLIA, and BASE_SEPOLIA."
exit 1
fi

# Run the cached-eth-rpc command with environment variables
exec /app/cached-eth-rpc --bind 0.0.0.0 --port 8080 \
--endpoint=eth-sepolia="$ETH_SEPOLIA" \
--endpoint=op-sepolia="$OP_SEPOLIA" \
--endpoint=base-sepolia="$BASE_SEPOLIA"

0 comments on commit ad95186

Please sign in to comment.