Skip to content
Merged
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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@
.DS_Store
Thumbs.db

# IDE
# IDE / tools
.vscode
.idea
.claude
*.swp
*.swo
*~

# Dependencies
node_modules

# Docker
*.log
data
23 changes: 20 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,51 @@
FROM node:22-trixie-slim

# Install global deps
RUN apt-get update && apt-get install -y --no-install-recommends sudo ca-certificates curl git build-essential procps file chromium && rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y --no-install-recommends sudo ca-certificates curl git build-essential python3 procps file chromium && rm -rf /var/lib/apt/lists/*

# Set home directory
ENV HOME=/data
WORKDIR /data
RUN mkdir -p /data && chown node:node /data

# Install OpenClaw globally from npm
RUN npm install -g openclaw@2026.2.23
RUN npm install -g openclaw@2026.2.25

# Redirect future npm global installs to persistent volume
ENV NPM_CONFIG_PREFIX=/data/.npm-global

# Install setup server dependencies (node-pty needs build tools, do this as root)
COPY package.json package-lock.json /app/
RUN cd /app && npm ci --omit=dev && chown -R node:node /data

# Switch to non-root user
RUN echo "node ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER node

# Install brew
RUN /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Shim systemctl for Docker — there's no systemd in the container, but OpenClaw's
# agent calls `systemctl --user restart openclaw-gateway` to restart the gateway.
# This script skips flags like --user to find the subcommand (restart/stop/start),
# then kills the gateway process by its process title ("openclaw-gateway").
# The container's `restart: unless-stopped` policy brings everything back.
# `|| true` prevents pkill's non-zero exit code from making the restart look like
# a failure to the agent. The pkill target matches the gateway's runtime process
# title, not the binary name — if the OpenClaw version changes, verify with `ps aux`.
RUN printf '#!/bin/bash\n# Skip flags (e.g. --user) to find the actual subcommand\ncmd=""\nfor arg in "$@"; do\n case "$arg" in\n -*) ;;\n *) cmd="$arg"; break ;;\n esac\ndone\ncase "$cmd" in\n restart|stop) pkill -f "openclaw-gateway" 2>/dev/null || true ;;\n start) echo "openclaw-gateway is managed by the container" ;;\n *) exit 0 ;;\nesac\n' | sudo tee /usr/local/bin/systemctl \
&& sudo chmod +x /usr/local/bin/systemctl

# Replace apt/apt-get with script telling openclaw to use brew
RUN printf '#!/bin/bash\necho "Error: apt is not available. Please use brew instead." >&2\necho "Example: brew install <package>" >&2\nexit 1\n' | sudo tee /usr/local/bin/use-brew \
&& sudo chmod +x /usr/local/bin/use-brew \
&& sudo ln -s /usr/local/bin/use-brew /usr/local/bin/apt \
&& sudo ln -s /usr/local/bin/use-brew /usr/local/bin/apt-get

# Copy setup UI server
# Copy setup UI server and static files
COPY --chown=node:node server.cjs /app/setup-server.cjs
COPY --chown=node:node setup.html /app/setup.html
COPY --chown=node:node logo.webp /app/logo.webp

# Move home to skeleton
RUN sudo mv /data /home-skeleton
Expand Down
Binary file added logo.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 53 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "openclaw-umbrel",
"version": "1.0.0",
"private": true,
"dependencies": {
"node-pty": "^1.0.0",
"ws": "^8.18.0"
}
}
Loading