From be830cc7c2236b879aec85a2d2409949504c56d0 Mon Sep 17 00:00:00 2001 From: "Fly.io" Date: Tue, 17 Mar 2026 14:19:50 +0000 Subject: [PATCH 1/2] New files from Fly.io Launch --- .dockerignore | 2 ++ Dockerfile | 20 ++++++++++++++++++++ fly.toml | 26 ++++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 fly.toml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e34d9c7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +fly.toml +.git/ diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2571467 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef +WORKDIR /app + +FROM chef AS planner +COPY . . +RUN cargo chef prepare --recipe-path recipe.json + +FROM chef AS builder +COPY --from=planner /app/recipe.json recipe.json +# Build dependencies - this is the caching Docker layer! +RUN cargo chef cook --release --recipe-path recipe.json +# Build application +COPY . . +RUN cargo build --release --bin zero2prod + +# We do not need the Rust toolchain to run the binary! +FROM debian:bookworm-slim AS runtime +WORKDIR /app +COPY --from=builder /app/target/release/zero2prod /usr/local/bin +ENTRYPOINT ["/usr/local/bin/zero2prod"] diff --git a/fly.toml b/fly.toml new file mode 100644 index 0000000..c83f5b2 --- /dev/null +++ b/fly.toml @@ -0,0 +1,26 @@ +# fly.toml app configuration file generated for app-crimson-frog-8696 on 2026-03-17T14:19:46Z +# +# See https://fly.io/docs/reference/configuration/ for information about how to use this file. +# + +app = 'app-crimson-frog-8696' +primary_region = 'iad' + +[build] + +[env] + PORT = '8080' + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = 'stop' + auto_start_machines = true + min_machines_running = 0 + processes = ['app'] + +[[vm]] + memory = '1gb' + cpu_kind = 'shared' + cpus = 1 + memory_mb = 256 From 4f375c9e3891d62183ec89b0d27441fb29cc24e3 Mon Sep 17 00:00:00 2001 From: Jourdain-Alexander Casale Date: Tue, 17 Mar 2026 10:30:04 -0400 Subject: [PATCH 2/2] fly.io fixes --- .github/workflows/deploy.yml | 13 +++++++++++++ fly.toml | 3 +-- 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/deploy.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..18e1aa0 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,13 @@ +name: Deploy to Fly.io +on: + push: + branches: [main] +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: superfly/flyctl-actions/setup-flyctl@master + - run: flyctl deploy --remote-only + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/fly.toml b/fly.toml index c83f5b2..41b6fcd 100644 --- a/fly.toml +++ b/fly.toml @@ -3,7 +3,7 @@ # See https://fly.io/docs/reference/configuration/ for information about how to use this file. # -app = 'app-crimson-frog-8696' +app = 'zero2prod-53ezmw' primary_region = 'iad' [build] @@ -20,7 +20,6 @@ primary_region = 'iad' processes = ['app'] [[vm]] - memory = '1gb' cpu_kind = 'shared' cpus = 1 memory_mb = 256