agent-browser/docker/docker-compose.yml

75 lines
2.5 KiB
YAML
Raw Permalink Normal View History

2026-01-11 03:23:39 -06:00
# Docker Compose for building agent-browser
2026-01-11 04:30:01 -06:00
# Usage: docker compose -f docker/docker-compose.yml run build-linux
2026-01-11 09:54:51 -06:00
# docker compose -f docker/docker-compose.yml run build-windows
2026-01-11 03:23:39 -06:00
#
2026-01-11 04:30:01 -06:00
# Note: macOS builds should be done natively on macOS for compatibility.
2026-01-11 03:23:39 -06:00
services:
2026-01-11 09:54:51 -06:00
# Build for Linux platforms
2026-01-11 04:30:01 -06:00
build-linux:
2026-01-11 03:23:39 -06:00
build:
context: ..
dockerfile: docker/Dockerfile.build
volumes:
- ../cli:/build
- ../bin:/output
command: |
-c '
set -e
2026-01-11 09:59:20 -06:00
echo "Building for Linux platforms (parallel)..."
2026-01-11 03:23:39 -06:00
2026-01-11 09:59:20 -06:00
# Build both targets in parallel
(echo "→ Linux x64" && cargo zigbuild --release --target x86_64-unknown-linux-gnu && cp /build/target/x86_64-unknown-linux-gnu/release/agent-browser /output/agent-browser-linux-x64 && chmod +x /output/agent-browser-linux-x64 && echo "✓ Linux x64 done") &
PID1=$!
2026-01-11 03:23:39 -06:00
2026-01-11 09:59:20 -06:00
(echo "→ Linux ARM64" && cargo zigbuild --release --target aarch64-unknown-linux-gnu && cp /build/target/aarch64-unknown-linux-gnu/release/agent-browser /output/agent-browser-linux-arm64 && chmod +x /output/agent-browser-linux-arm64 && echo "✓ Linux ARM64 done") &
PID2=$!
# Wait for both to complete
wait $PID1 $PID2
2026-01-11 03:23:39 -06:00
echo ""
2026-01-11 04:30:01 -06:00
echo "✓ Linux platforms built successfully!"
ls -la /output/agent-browser-linux-*
2026-01-11 03:23:39 -06:00
'
2026-01-11 09:54:51 -06:00
# Build for Windows
build-windows:
build:
context: ..
dockerfile: docker/Dockerfile.build
volumes:
- ../cli:/build
- ../bin:/output
command: |
-c '
set -e
echo "Building for Windows x64..."
cargo build --release --target x86_64-pc-windows-gnu
cp /build/target/x86_64-pc-windows-gnu/release/agent-browser.exe /output/agent-browser-win32-x64.exe
echo ""
echo "✓ Windows build completed!"
ls -la /output/agent-browser-win32-*
'
2026-01-11 03:23:39 -06:00
# Build for a single target (override with TARGET env var)
build-single:
build:
context: ..
dockerfile: docker/Dockerfile.build
volumes:
- ../cli:/build
- ../bin:/output
environment:
- TARGET=${TARGET:-x86_64-unknown-linux-gnu}
- OUTPUT_NAME=${OUTPUT_NAME:-agent-browser-linux-x64}
command: |
-c '
cargo zigbuild --release --target $TARGET
cp /build/target/$TARGET/release/agent-browser* /output/$OUTPUT_NAME
chmod +x /output/$OUTPUT_NAME 2>/dev/null || true
echo "✓ Built $OUTPUT_NAME"
'