-
-
Notifications
You must be signed in to change notification settings - Fork 194
/
Copy pathdocker-compose.yaml
60 lines (53 loc) · 1.86 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
version: '3.7'
services:
tauri:
image: ubuntu:22.04
volumes:
- .:/app
# 只挂载构建产物目录
- ./src-tauri/target/release:/app/src-tauri/target/release
environment:
- RUST_BACKTRACE=1
- CARGO_HOME=/root/.cargo
- RUSTUP_HOME=/root/.rustup
- DEBIAN_FRONTEND=noninteractive
command:
- 'bash'
- '-c'
- |
cd /app
apt-get update
apt-get install -y curl git build-essential libwebkit2gtk-4.1-dev librsvg2-dev patchelf libudev-dev \
libasound2-dev pkg-config libgtk-3-dev libayatana-appindicator3-dev
# 安装 Node.js 22
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
apt-get install -y nodejs
npm install -g npm@latest
# 安装指定版本的 pnpm
npm install -g pnpm@9
pnpm --version
# 安装 Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$CARGO_HOME/env"
# 配置镜像源
pnpm config set registry https://repo.huaweicloud.com/repository/npm/
rustup default stable
mkdir -p ~/.cargo
echo '[source.crates-io]
replace-with = "rsproxy-sparse"
[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"
[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"' > ~/.cargo/config.toml
# 构建项目
cd /app
echo "📦 Installing dependencies..."
rm -rf node_modules pnpm-lock.yaml
pnpm install
echo "🔨 Building Vite project..."
pnpm build || exit 1
echo "✨ Starting Tauri build..."
pnpm tauri build || exit 1
echo "✅ Tauri build completed. Check src-tauri/target/release for the output."