From 7f402bd070b2600d8ac9e702ed6f4febc2da895e Mon Sep 17 00:00:00 2001 From: Mike English Date: Fri, 15 Sep 2023 16:10:13 -0400 Subject: [PATCH] Update fly.io deployment (#71) --- Dockerfile | 3 +++ fly-relay.sh | 8 ++++++++ fly.toml | 2 +- 3 files changed, 12 insertions(+), 1 deletion(-) create mode 100755 fly-relay.sh diff --git a/Dockerfile b/Dockerfile index 45f7fb4..a9dc920 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,5 +15,8 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry \ # Runtime image FROM rust:latest +# Fly.io entrypoint +ADD fly-relay.sh . + # Copy the compiled binaries COPY --from=builder /usr/local/cargo/bin /usr/local/cargo/bin diff --git a/fly-relay.sh b/fly-relay.sh new file mode 100755 index 0000000..26de9b1 --- /dev/null +++ b/fly-relay.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh + +mkdir cert +# Nothing to see here... +echo "$MOQ_CRT" | base64 -d > dev/moq-demo.crt +echo "$MOQ_KEY" | base64 -d > dev/moq-demo.key + +RUST_LOG=info /usr/local/cargo/bin/moq-relay --cert dev/moq-demo.crt --key dev/moq-demo.key diff --git a/fly.toml b/fly.toml index cf62599..1d42dd6 100644 --- a/fly.toml +++ b/fly.toml @@ -6,7 +6,7 @@ kill_timeout = 5 PORT = "4443" [experimental] - cmd = "./entrypoint.sh" + cmd = "./fly-relay.sh" [[services]] internal_port = 4443