Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@ jobs:
file: docker/universal/Dockerfile
target: engine-full
platforms: ${{ matrix.platform }}
build-args: |
BUILD_FRONTEND=true
# secrets: |
# fontawesome_package_token=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
# secret-files: |
Expand All @@ -205,6 +207,8 @@ jobs:
file: docker/universal/Dockerfile
target: engine-slim
platforms: ${{ matrix.platform }}
build-args: |
BUILD_FRONTEND=true
# secrets: |
# fontawesome_package_token=${{ secrets.FONTAWESOME_PACKAGE_TOKEN }}
# secret-files: |
Expand Down
24 changes: 23 additions & 1 deletion docker/engine/linux-aarch64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# syntax=docker/dockerfile:1.4
FROM rust:1.88.0 AS base

ARG BUILD_FRONTEND=true
ARG VITE_APP_API_URL

# Install dependencies
RUN apt-get update && apt-get install -y \
musl-tools \
Expand All @@ -13,12 +17,19 @@ RUN apt-get update && apt-get install -y \
ca-certificates \
g++ \
g++-multilib \
git-lfs && \
git-lfs \
curl && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
corepack enable && \
rm -rf /var/lib/apt/lists/* && \
wget -q https://github.com/cross-tools/musl-cross/releases/download/20250815/aarch64-unknown-linux-musl.tar.xz && \
tar -xzf aarch64-unknown-linux-musl.tgz -C /opt/ && \
rm aarch64-unknown-linux-musl.tgz

# Disable interactive prompt
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

# Install musl targets
RUN rustup target add aarch64-unknown-linux-musl

Expand Down Expand Up @@ -60,6 +71,17 @@ ENV OPENSSL_DIR=/musl-aarch64 \
# Copy the source code
COPY . .

# Build frontend
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
(cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
(cd frontend && pnpm install && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
else \
pnpm run build:engine; \
fi); \
fi

# Build for Linux with musl (static binary) - aarch64
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand Down
23 changes: 22 additions & 1 deletion docker/engine/linux-x86_64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1.4
FROM rust:1.88.0 AS base

ARG BUILD_FRONTEND=true
ARG VITE_APP_API_URL

# Install dependencies
RUN apt-get update && apt-get install -y \
musl-tools \
Expand All @@ -14,12 +17,19 @@ RUN apt-get update && apt-get install -y \
ca-certificates \
g++ \
g++-multilib \
git-lfs && \
git-lfs \
curl && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
corepack enable && \
rm -rf /var/lib/apt/lists/* && \
wget -q https://github.com/cross-tools/musl-cross/releases/latest/download/x86_64-unknown-linux-musl.tar.xz && \
tar -xf x86_64-unknown-linux-musl.tar.xz -C /opt/ && \
rm x86_64-unknown-linux-musl.tar.xz

# Disable interactive prompt
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

# Install musl targets
RUN rustup target add x86_64-unknown-linux-musl

Expand Down Expand Up @@ -61,6 +71,17 @@ ENV OPENSSL_DIR=/musl \
# Copy the source code
COPY . .

# Build frontend
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
(cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
(cd frontend && pnpm install && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
else \
pnpm run build:engine; \
fi); \
fi

# Build for Linux with musl (static binary) - x86_64
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand Down
24 changes: 22 additions & 2 deletions docker/engine/macos-aarch64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1.4
FROM rust:1.88.0 AS base

ARG BUILD_FRONTEND=true
ARG VITE_APP_API_URL

# Install dependencies
RUN apt-get update && apt-get install -y \
git-lfs \
Expand All @@ -11,8 +14,11 @@ RUN apt-get update && apt-get install -y \
libxml2-dev \
wget \
xz-utils \
curl \
&& rm -rf /var/lib/apt/lists/*
curl && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
corepack enable && \
rm -rf /var/lib/apt/lists/*

# Install osxcross
RUN git config --global --add safe.directory '*' && \
Expand All @@ -25,6 +31,9 @@ RUN git config --global --add safe.directory '*' && \
# Add osxcross to PATH
ENV PATH="/root/osxcross/target/bin:$PATH"

# Disable interactive prompt
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

# Tell Clang/bindgen to use the macOS SDK, and nudge Clang to prefer osxcross binutils.
ENV OSXCROSS_SDK=MacOSX11.3.sdk \
SDKROOT=/root/osxcross/target/SDK/MacOSX11.3.sdk \
Expand Down Expand Up @@ -61,6 +70,17 @@ ar = "aarch64-apple-darwin20.4-ar"\n\
# Copy the source code
COPY . .

# Build frontend
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
(cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
(cd frontend && pnpm install && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
else \
pnpm run build:engine; \
fi); \
fi

# Build for ARM64 macOS
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand Down
24 changes: 22 additions & 2 deletions docker/engine/macos-x86_64.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1.4
FROM rust:1.88.0 AS base

ARG BUILD_FRONTEND=true
ARG VITE_APP_API_URL

# Install dependencies
RUN apt-get update && apt-get install -y \
git-lfs \
Expand All @@ -11,8 +14,11 @@ RUN apt-get update && apt-get install -y \
libxml2-dev \
wget \
xz-utils \
curl \
&& rm -rf /var/lib/apt/lists/*
curl && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
corepack enable && \
rm -rf /var/lib/apt/lists/*

# Install osxcross
RUN git config --global --add safe.directory '*' && \
Expand All @@ -25,6 +31,9 @@ RUN git config --global --add safe.directory '*' && \
# Add osxcross to PATH
ENV PATH="/root/osxcross/target/bin:$PATH"

# Disable interactive prompt
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

# Tell Clang/bindgen to use the macOS SDK, and nudge Clang to prefer osxcross binutils.
ENV OSXCROSS_SDK=MacOSX11.3.sdk \
SDKROOT=/root/osxcross/target/SDK/MacOSX11.3.sdk \
Expand Down Expand Up @@ -61,6 +70,17 @@ ar = "x86_64-apple-darwin20.4-ar"\n\
# Copy the source code
COPY . .

# Build frontend
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
(cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
(cd frontend && pnpm install && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
else \
pnpm run build:engine; \
fi); \
fi

# Build for x86_64 macOS
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand Down
23 changes: 22 additions & 1 deletion docker/engine/windows.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# syntax=docker/dockerfile:1.4
FROM rust:1.88.0

ARG BUILD_FRONTEND=true
ARG VITE_APP_API_URL

# Install dependencies
RUN apt-get update && apt-get install -y \
llvm-14-dev \
Expand All @@ -12,12 +15,19 @@ RUN apt-get update && apt-get install -y \
g++-mingw-w64-x86-64 \
binutils-mingw-w64-x86-64 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
curl && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get install -y nodejs && \
corepack enable && \
rm -rf /var/lib/apt/lists/*

# Switch MinGW-w64 to the POSIX threading model toolchain
RUN update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix && \
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix

# Disable interactive prompt
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

# Install target
RUN rustup target add x86_64-pc-windows-gnu

Expand Down Expand Up @@ -48,6 +58,17 @@ WORKDIR /build
# Copy the source code
COPY . .

# Build frontend
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
(cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
(cd frontend && pnpm install && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
else \
pnpm run build:engine; \
fi); \
fi

# Build for Windows
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
Expand Down
10 changes: 7 additions & 3 deletions docker/universal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ FROM --platform=linux/amd64 rust:1.88.0-bookworm AS builder
ARG TARGETARCH

ARG BUILD_FRONTEND=false
ARG VITE_APP_API_URL

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update -y && \
Expand Down Expand Up @@ -38,8 +39,6 @@ RUN apt-get update -y && \
# Disable interactive prompt
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0

ENV RIVET_SKIP_BUILD_TS_SDK=1

# Pull via Git CLI to improve reliability in CI
ENV CARGO_NET_GIT_FETCH_WITH_CLI=true

Expand All @@ -50,7 +49,12 @@ COPY . .
# Build frontend
RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
(cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
(cd frontend && pnpm install && pnpm run build); \
(cd frontend && pnpm install && \
if [ -n "$VITE_APP_API_URL" ]; then \
VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
else \
pnpm run build:engine; \
fi); \
fi

# Build and copy all binaries from target directory into an empty image (it is not
Expand Down
Loading