Skip to content

Commit

Permalink
Merge pull request #37 from superfly/config-fly-example
Browse files Browse the repository at this point in the history
Configure Fly.io example addresses with entrypoint script
  • Loading branch information
jeromegn authored Aug 24, 2023
2 parents a97f0de + dc316ce commit 2722925
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/fly/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ path = "/var/lib/corrosion/state.db"
schema_paths = ["/app/schemas"]

[gossip]
addr = "fly-local-6pn:8787"
bootstrap = ["corrosion2.internal:8787"]
# addr and bootstrap for Fly.io deployment example are written
# on startup by entrypoint script
plaintext = true
max_mtu = 1372
disable_gso = true
Expand Down
7 changes: 4 additions & 3 deletions examples/fly/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash

export GOSSIP__ADDR="[$(getent hosts fly-local-6pn | cut -d ' ' -f1)]:8787"

echo "Set GOSSIP__ADDR=$GOSSIP__ADDR"
# Add gossip and bootstrap addresses to Corrosion config file before
# starting agent with Dockerfile CMD
sed -i 's/\[gossip\]/&\naddr = "['${FLY_PRIVATE_IP}']:8787"\
bootstrap = ["'${FLY_APP_NAME}'.internal:8787"]/' /app/config.toml

exec "$@"

0 comments on commit 2722925

Please sign in to comment.