Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

feat(sandbox): add docker sandbox container definition and chromium entrypoint

Oleksandr Ivanchenkoe1e0655c5d18
diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh
new file mode 100755
index 00000000..7a992523
--- /dev/null
+++ b/docker/entrypoint.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+
+# Launch Chromium in headless mode with remote debugging enabled
+chromium \
+ --headless=new \
+ --remote-debugging-port=9222 \
+ --remote-debugging-address=0.0.0.0 \
+ --no-sandbox \
+ --disable-gpu \
+ --disable-dev-shm-usage \
+ --disable-software-rasterizer \
+ --window-size=1280,800 &
+
+exec sleep infinity
diff --git a/docker/sandbox.Dockerfile b/docker/sandbox.Dockerfile
new file mode 100644
index 00000000..eece819e
--- /dev/null
+++ b/docker/sandbox.Dockerfile
@@ -0,0 +1,25 @@
+FROM debian:bookworm-slim
+
+ENV DEBIAN_FRONTEND=noninteractive
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ bash \
+ coreutils \
+ curl \
+ git \
+ jq \
+ python3 \
+ python3-pip \
+ ca-certificates \
+ chromium \
+ fonts-liberation \
+ fonts-noto-color-emoji \
+ && rm -rf /var/lib/apt/lists/*
+
+WORKDIR /workspace
+
+EXPOSE 9222
+
+COPY docker/entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+
+ENTRYPOINT ["/entrypoint.sh"]
diff --git a/tests/docker_packaging_test.rs b/tests/docker_packaging_test.rs
new file mode 100644
index 00000000..ba6b5dd9
--- /dev/null
+++ b/tests/docker_packaging_test.rs
@@ -0,0 +1,19 @@
+use std::path::Path;
+
+#[test]
+fn test_docker_packaging_files_exist_and_valid() {
+ let dockerfile = Path::new("docker/sandbox.Dockerfile");
+ let entrypoint = Path::new("docker/entrypoint.sh");
+
+ assert!(dockerfile.exists(), "docker/sandbox.Dockerfile must exist");
+ assert!(entrypoint.exists(), "docker/entrypoint.sh must exist");
+
+ let df_content = std::fs::read_to_string(dockerfile).unwrap();
+ assert!(df_content.contains("FROM debian:bookworm-slim"));
+ assert!(df_content.contains("chromium"));
+ assert!(df_content.contains("EXPOSE 9222"));
+
+ let ep_content = std::fs::read_to_string(entrypoint).unwrap();
+ assert!(ep_content.contains("--remote-debugging-port=9222"));
+ assert!(ep_content.contains("--headless"));
+}