@@ -8,7 +8,8 @@ FROM --platform=linux/amd64 rust:1.88.0-bookworm AS builder
8
8
ARG TARGETARCH
9
9
10
10
ARG BUILD_FRONTEND=false
11
- ARG VITE_APP_API_URL
11
+ ARG CARGO_BUILD_MODE=debug
12
+ ARG VITE_APP_API_URL=__SAME__
12
13
13
14
ENV DEBIAN_FRONTEND=noninteractive
14
15
RUN apt-get update -y && \
@@ -65,10 +66,14 @@ RUN \
65
66
--mount=type=cache,target=/usr/local/cargo/registry,id=univseral-cargo-registry \
66
67
--mount=type=cache,target=/app/target,id=univseral-target \
67
68
--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 && \
69
74
# cargo install --locked tokio-console && \
70
75
mkdir /app/dist/ && \
71
- cp target/debug /rivet-engine /app/dist/
76
+ cp target/$CARGO_BUILD_MODE /rivet-engine /app/dist/
72
77
73
78
# MARK: Engine (full, base)
74
79
FROM --platform=linux/amd64 debian:12.9-slim AS engine-full-base
@@ -78,23 +83,13 @@ ARG TARGETARCH
78
83
79
84
ENV DEBIAN_FRONTEND=noninteractive
80
85
# - 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)
83
86
RUN apt-get update -y && \
84
87
apt-get install -y \
85
88
ca-certificates \
86
89
openssl \
87
90
curl \
88
- # redis-tools \
89
- # postgresql-client \
90
91
gpg \
91
92
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 && \
98
93
apt-get clean && \
99
94
rm -rf /var/lib/apt/lists/* && \
100
95
if [ "$TARGETARCH" = "arm64" ]; then \
@@ -106,7 +101,7 @@ RUN apt-get update -y && \
106
101
# MARK: Engine (Full)
107
102
FROM --platform=linux/amd64 engine-full-base AS engine-full
108
103
109
- LABEL org.opencontainers.image.source https://github.com/rivet-gg/rivet
104
+ LABEL org.opencontainers.image.source= https://github.com/rivet-gg/rivet
110
105
111
106
COPY --from=builder /app/dist/rivet-engine /usr/bin/rivet-engine
112
107
0 commit comments