diff --git a/cmd/faucet/main.go b/cmd/faucet/main.go index 28c281c..db41cce 100644 --- a/cmd/faucet/main.go +++ b/cmd/faucet/main.go @@ -48,9 +48,9 @@ func init() { rpcEndpoint := os.Getenv("RPC_ENDPOINT") if rpcEndpoint == "" { - rpcEndpoint = "localhost:9650" + rpcEndpoint = "http://localhost:9650" } - url := fmt.Sprintf("http://%s/ext/bc/morpheusvm", rpcEndpoint) + url := fmt.Sprintf("%s/ext/bc/morpheusvm", rpcEndpoint) cli = rpc.NewJSONRPCClient(url) networkID, subnetID, chainID, err := cli.Network(context.TODO()) diff --git a/deploy/Dockerfile.faucet b/deploy/Dockerfile.faucet index bce06c0..d59333d 100644 --- a/deploy/Dockerfile.faucet +++ b/deploy/Dockerfile.faucet @@ -19,7 +19,6 @@ RUN --mount=type=cache,target=/go/pkg/mod \ ##### FROM debian:bookworm-slim -ENV RPC_ENDPOINT=devnet:9650 COPY --from=faucet-builder /build/build/faucet /faucet ENTRYPOINT ["/faucet"] \ No newline at end of file diff --git a/deploy/compose.yml b/deploy/compose.yml index ca3b718..fb60876 100644 --- a/deploy/compose.yml +++ b/deploy/compose.yml @@ -24,9 +24,11 @@ services: context: ../ environment: - FAUCET_PRIVATE_KEY_HEX=323b1d8f4eed5f0da9da93071b034f2dce9d2d22692c172f3cb252a64ddfafd01b057de320297c29ad0c1f589ea216869cf1938d88c9fbd70d6748323dbf2fa7 + - RPC_ENDPOINT=http://devnet:9650 restart: always ports: - "127.0.0.1:8765:8765" + # TODO: restore healthcheck # healthcheck: # test: ["CMD", "nc", "-z", "localhost", "8765"] diff --git a/deploy/deploy.sh b/deploy/deploy.sh index 78fff73..5214f42 100755 --- a/deploy/deploy.sh +++ b/deploy/deploy.sh @@ -6,7 +6,7 @@ if [ -f .env ]; then export $(grep -v '^#' .env | xargs) fi -if [ -f .env ] && grep -q "SERVE_DOMAIN" .env; then +if [ -n "${SERVE_DOMAIN}" ]; then docker compose up -d --build # remote, deploy caddy too else docker compose up -d --build devnet faucet # local, no reverse proxy