2022-09-20 14:01:24 -07:00
|
|
|
# syntax = docker/dockerfile:1.2
|
|
|
|
# Base image containing all binaries, deployed to gcr.io/mango-markets/mango-geyser-services:latest
|
2023-09-06 08:23:27 -07:00
|
|
|
FROM rust:1.71.1-bullseye as base
|
2023-04-07 18:32:17 -07:00
|
|
|
RUN cargo install cargo-chef
|
2022-09-20 14:01:24 -07:00
|
|
|
RUN rustup component add rustfmt
|
2023-01-03 16:04:35 -08:00
|
|
|
RUN apt-get update && apt-get install -y clang cmake ssh
|
2022-09-20 14:01:24 -07:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
FROM base AS plan
|
|
|
|
COPY . .
|
2022-11-16 06:57:50 -08:00
|
|
|
WORKDIR /app
|
2023-09-06 08:23:27 -07:00
|
|
|
RUN rustup show
|
2023-04-07 18:32:17 -07:00
|
|
|
RUN cargo chef prepare --recipe-path recipe.json
|
2022-09-20 14:01:24 -07:00
|
|
|
|
|
|
|
FROM base as build
|
2023-04-07 18:32:17 -07:00
|
|
|
COPY --from=plan /app/recipe.json recipe.json
|
|
|
|
RUN cargo chef cook --release --recipe-path recipe.json
|
2022-09-20 14:01:24 -07:00
|
|
|
COPY . .
|
2023-01-03 16:04:35 -08:00
|
|
|
RUN cargo build --release --bin service-mango-fills --bin service-mango-pnl --bin service-mango-orderbook
|
2022-09-20 14:01:24 -07:00
|
|
|
|
|
|
|
FROM debian:bullseye-slim as run
|
|
|
|
RUN apt-get update && apt-get -y install ca-certificates libc6
|
|
|
|
COPY --from=build /app/target/release/service-mango-* /usr/local/bin/
|
2023-04-07 08:27:54 -07:00
|
|
|
COPY --from=build /app/service-mango-pnl/conf/template-config.toml ./pnl-config.toml
|
|
|
|
COPY --from=build /app/service-mango-fills/conf/template-config.toml ./fills-config.toml
|
|
|
|
COPY --from=build /app/service-mango-orderbook/conf/template-config.toml ./orderbook-config.toml
|