feat(docker): add dev container setup for source-mounted development

This commit is contained in:
dorkitude 2026-01-30 01:08:56 -06:00
parent 9025da2296
commit 8f0a9418a7
2 changed files with 39 additions and 0 deletions

14
Dockerfile.dev Normal file
View File

@ -0,0 +1,14 @@
FROM node:22-bookworm
# Enable corepack (pnpm) as root
RUN corepack enable
# Create user matching host UID
ARG HOST_UID=1001
ARG HOST_GID=1001
RUN groupadd -g $HOST_GID devuser || true && \
useradd -m -u $HOST_UID -g $HOST_GID -s /bin/bash devuser || true
WORKDIR /app
USER devuser

25
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,25 @@
services:
openclaw-dev:
build:
context: .
dockerfile: Dockerfile.dev
args:
HOST_UID: 1001
HOST_GID: 1001
working_dir: /app
environment:
HOME: /home/devuser
TERM: xterm-256color
NODE_ENV: development
volumes:
# Mount source code (node_modules stays on host)
- .:/app
# Config and workspace
- ${OPENCLAW_CONFIG_DIR:-~/.openclaw}:/home/devuser/.openclaw
- ${OPENCLAW_WORKSPACE_DIR:-~/.openclaw/workspace}:/home/devuser/.openclaw/workspace
ports:
- "${OPENCLAW_GATEWAY_PORT:-18789}:18789"
- "${OPENCLAW_BRIDGE_PORT:-18790}:18790"
stdin_open: true
tty: true
init: true