From 95bb295fbf31fcf3d924dcabedbe86015571e4aa Mon Sep 17 00:00:00 2001 From: Daniel Freire Date: Fri, 3 May 2024 09:50:17 -0300 Subject: [PATCH] improter online --- config/production.yaml | 2 +- docker/Dockerfile.importer_online_postgres | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docker/Dockerfile.importer_online_postgres diff --git a/config/production.yaml b/config/production.yaml index b0d54afb1..330bfc487 100644 --- a/config/production.yaml +++ b/config/production.yaml @@ -74,7 +74,7 @@ kubernetes: # EVM api postgres storage # -------------------------------------------------------------------------- - name: stratus-api-postgres - dockerfile: ./docker/Dockerfile.run_with_importer_postgres + dockerfile: ./docker/Dockerfile.importer_online_postgres secretsManager: enabled: true provider: gcpsm diff --git a/docker/Dockerfile.importer_online_postgres b/docker/Dockerfile.importer_online_postgres new file mode 100644 index 000000000..05d2db339 --- /dev/null +++ b/docker/Dockerfile.importer_online_postgres @@ -0,0 +1,22 @@ +# Build +FROM rust:1.75 as builder + +WORKDIR /app +COPY src /app/src +COPY static /app/static +COPY .sqlx /app/.sqlx +COPY build.rs /app/build.rs +COPY Cargo.toml /app/Cargo.toml +COPY Cargo.lock /app/Cargo.lock + +RUN apt update +RUN apt-get install -y libclang-dev cmake + +RUN cargo build --release --bin importer-online --features metrics + +# Runtime +FROM rust:1.75 as runtime +WORKDIR /app +COPY --from=builder /app/target/release/importer-online /app/importer-online + +CMD ["sh", "-c", "/app/importer-online"]