@@ -8,6 +8,7 @@ FROM --platform=linux/amd64 rust:1.88.0-bookworm AS builder
88ARG TARGETARCH
99
1010ARG BUILD_FRONTEND=false
11+ ARG CARGO_BUILD_MODE=debug
1112ARG VITE_APP_API_URL
1213
1314ENV DEBIAN_FRONTEND=noninteractive
@@ -65,10 +66,14 @@ RUN \
6566 --mount=type=cache,target=/usr/local/cargo/registry,id=univseral-cargo-registry \
6667 --mount=type=cache,target=/app/target,id=univseral-target \
6768 --mount=type=cache,target=/root/.cache,id=universal-user-cache \
68- RUSTFLAGS="--cfg tokio_unstable" cargo build --bin rivet-engine && \
69+ if [ "$CARGO_BUILD_MODE" = "release" ]; then \
70+ RUSTFLAGS="--cfg tokio_unstable" cargo build --bin rivet-engine --release; \
71+ else \
72+ RUSTFLAGS="--cfg tokio_unstable" cargo build --bin rivet-engine; \
73+ fi && \
6974 # cargo install --locked tokio-console && \
7075 mkdir /app/dist/ && \
71- cp target/debug /rivet-engine /app/dist/
76+ cp target/$CARGO_BUILD_MODE /rivet-engine /app/dist/
7277
7378# MARK: Engine (full, base)
7479FROM --platform=linux/amd64 debian:12.9-slim AS engine-full-base
@@ -78,23 +83,13 @@ ARG TARGETARCH
7883
7984ENV DEBIAN_FRONTEND=noninteractive
8085# - Install curl for health checks
81- # - Install go-migrate for running migrations
82- # - Install database clients to be able to run `rivet db shell ...` (Redis, Postgres, ClickHouse)
8386RUN apt-get update -y && \
8487 apt-get install -y \
8588 ca-certificates \
8689 openssl \
8790 curl \
88- # redis-tools \
89- # postgresql-client \
9091 gpg \
9192 dirmngr && \
92- # curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg && \
93- # echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | tee /etc/apt/sources.list.d/clickhouse.list && \
94- # apt-get update -y && \
95- # apt-get install -y clickhouse-client && \
96- # (curl -L https://github.com/golang-migrate/migrate/releases/download/v4.18.1/migrate.linux-amd64.tar.gz | tar xvz) && \
97- # mv migrate /usr/local/bin/migrate && \
9893 apt-get clean && \
9994 rm -rf /var/lib/apt/lists/* && \
10095 if [ "$TARGETARCH" = "arm64" ]; then \
@@ -106,7 +101,7 @@ RUN apt-get update -y && \
106101# MARK: Engine (Full)
107102FROM --platform=linux/amd64 engine-full-base AS engine-full
108103
109- LABEL org.opencontainers.image.source https://github.com/rivet-gg/rivet
104+ LABEL org.opencontainers.image.source= https://github.com/rivet-gg/rivet
110105
111106COPY --from=builder /app/dist/rivet-engine /usr/bin/rivet-engine
112107
0 commit comments