-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
040553d
commit e73b332
Showing
5 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# flyctl launch added from .gitignore | ||
**/.DS_Store | ||
**/debug | ||
**/target | ||
**/.vim | ||
**/.direnv | ||
**/.env | ||
**/.fedimint-test-dir | ||
**/.test | ||
|
||
# These are backup files generated by rustfmt | ||
**/**/*.rs.bk | ||
|
||
# Clippy compile errors keep generating this | ||
**/rustc-ice-* | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
**/*.pdb | ||
|
||
**/*/bacon.toml | ||
fly.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
FROM rust:1.67-bookworm as builder | ||
|
||
WORKDIR /usr/src/app | ||
COPY . . | ||
|
||
# Get the target triple of the current build environment | ||
RUN echo "$(rustc -vV | sed -n 's|host: ||p')" > rust_target | ||
|
||
# cargo under QEMU building for ARM can consumes 10s of GBs of RAM... | ||
# Solution: https://users.rust-lang.org/t/cargo-uses-too-much-memory-being-run-in-qemu/76531/2 | ||
ENV CARGO_NET_GIT_FETCH_WITH_CLI true | ||
|
||
# Install clang and other required tools for compiling Rust projects with native dependencies | ||
RUN apt update && apt install --no-install-recommends -y \ | ||
build-essential \ | ||
pkg-config \ | ||
libssl-dev \ | ||
musl-dev \ | ||
clang | ||
|
||
# Will build and cache the binary and dependent crates in release mode | ||
RUN --mount=type=cache,target=/usr/local/cargo,from=rust:latest,source=/usr/local/cargo \ | ||
--mount=type=cache,target=target \ | ||
cargo build --target $(cat rust_target) --release && mv ./target/$(cat rust_target)/release/blinded-hermes ./blinded-hermes | ||
|
||
# Runtime image | ||
FROM debian:bookworm-slim | ||
|
||
RUN apt update && apt install -y openssl libpq-dev pkg-config libc6 clang | ||
|
||
# Run as "app" user | ||
RUN useradd -ms /bin/bash app | ||
|
||
USER app | ||
WORKDIR /app | ||
|
||
# Get compiled binaries from builder's cargo install directory | ||
COPY --from=builder /usr/src/app/blinded-hermes /app/blinded-hermes | ||
|
||
ENV HERMES_PORT=8080 | ||
EXPOSE $HERMES_PORT | ||
|
||
# Run the app | ||
CMD ["./blinded-hermes"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# fly.toml app configuration file generated for hermes-blinded-staging on 2024-03-26T00:55:46-05:00 | ||
# | ||
# See https://fly.io/docs/reference/configuration/ for information about how to use this file. | ||
# | ||
|
||
app = 'hermes-blinded-staging' | ||
primary_region = 'dfw' | ||
|
||
[build] | ||
|
||
[env] | ||
DOMAIN_URL = 'https://mutiny.plus' | ||
FM_DB_PATH = '/data' | ||
HERMES_PORT = '8080' | ||
RUST_LOG = 'debug' | ||
|
||
[mounts] | ||
source="hermes_data" | ||
destination="/data" | ||
|
||
[http_service] | ||
internal_port = 8080 | ||
force_https = true | ||
auto_stop_machines = false | ||
auto_start_machines = false | ||
min_machines_running = 1 | ||
processes = ['app'] | ||
|
||
[[http_service.checks]] | ||
interval = '5s' | ||
timeout = '5s' | ||
grace_period = '10s' | ||
method = 'GET' | ||
path = '/health-check' | ||
|
||
[[vm]] | ||
memory = '1gb' | ||
cpu_kind = 'shared' | ||
cpus = 1 |