1
1
# syntax=docker/dockerfile:1.4
2
2
FROM rust:1.88.0 AS base
3
3
4
+ ARG BUILD_FRONTEND=true
5
+ ARG VITE_APP_API_URL
6
+
4
7
# Install dependencies
5
8
RUN apt-get update && apt-get install -y \
6
9
git-lfs \
@@ -11,8 +14,11 @@ RUN apt-get update && apt-get install -y \
11
14
libxml2-dev \
12
15
wget \
13
16
xz-utils \
14
- curl \
15
- && rm -rf /var/lib/apt/lists/*
17
+ curl && \
18
+ curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
19
+ apt-get install -y nodejs && \
20
+ corepack enable && \
21
+ rm -rf /var/lib/apt/lists/*
16
22
17
23
# Install osxcross
18
24
RUN git config --global --add safe.directory '*' && \
@@ -25,6 +31,9 @@ RUN git config --global --add safe.directory '*' && \
25
31
# Add osxcross to PATH
26
32
ENV PATH="/root/osxcross/target/bin:$PATH"
27
33
34
+ # Disable interactive prompt
35
+ ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
36
+
28
37
# Tell Clang/bindgen to use the macOS SDK, and nudge Clang to prefer osxcross binutils.
29
38
ENV OSXCROSS_SDK=MacOSX11.3.sdk \
30
39
SDKROOT=/root/osxcross/target/SDK/MacOSX11.3.sdk \
@@ -61,6 +70,17 @@ ar = "aarch64-apple-darwin20.4-ar"\n\
61
70
# Copy the source code
62
71
COPY . .
63
72
73
+ # Build frontend
74
+ RUN if [ "$BUILD_FRONTEND" = "true" ]; then \
75
+ (cd sdks/typescript/api-full && pnpm install && pnpm run build) && \
76
+ (cd frontend && pnpm install && \
77
+ if [ -n "$VITE_APP_API_URL" ]; then \
78
+ VITE_APP_API_URL="${VITE_APP_API_URL}" pnpm run build:engine; \
79
+ else \
80
+ pnpm run build:engine; \
81
+ fi); \
82
+ fi
83
+
64
84
# Build for ARM64 macOS
65
85
RUN --mount=type=cache,target=/usr/local/cargo/registry \
66
86
--mount=type=cache,target=/usr/local/cargo/git \
0 commit comments