diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..f8701e14 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +/target +/node_modules +/test-ledger +/config +**/validator.log \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e018f5bc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +# syntax = docker/dockerfile:1.2 +FROM rust:1.65.0 as base +RUN cargo install cargo-chef +RUN rustup component add rustfmt +RUN apt-get update && apt-get install -y clang cmake ssh +WORKDIR /app + +FROM base AS plan +COPY . . +WORKDIR /app +RUN cargo chef prepare --recipe-path recipe.json + +FROM base as build +COPY --from=plan /app/recipe.json recipe.json +RUN cargo chef cook --release --recipe-path recipe.json +COPY . . +RUN cargo build --release --bin lite-rpc + +FROM debian:bullseye-slim as run +RUN apt-get update && apt-get -y install ca-certificates libc6 +COPY --from=build /app/target/release/lite-rpc /usr/local/bin/ + +CMD "lite-rpc --rpc-url $RPC_URL --websocket-url $WS_URL" \ No newline at end of file diff --git a/fly.toml b/fly.toml new file mode 100644 index 00000000..bbc6c7d5 --- /dev/null +++ b/fly.toml @@ -0,0 +1,31 @@ +app = "solana-lite-rpc" +kill_signal = "SIGINT" +kill_timeout = 5 + +[env] + PORT_HTTP = "9000" + PORT_WS = "9001" + +[[services]] + internal_port = 9000 + processes = ["app"] + protocol = "tcp" + + [services.concurrency] + hard_limit = 1024 + soft_limit = 1024 + type = "connections" + +[[services]] + internal_port = 9001 + processes = ["app"] + protocol = "tcp" + + [services.concurrency] + hard_limit = 1024 + soft_limit = 1024 + type = "connections" + +[metrics] + path = "/metrics" + port = 9091