feat: add Dockerfile for containerized deployment (#3)#10
Closed
addidea wants to merge 1 commit intoClawland-AI:mainfrom
Closed
feat: add Dockerfile for containerized deployment (#3)#10addidea wants to merge 1 commit intoClawland-AI:mainfrom
addidea wants to merge 1 commit intoClawland-AI:mainfrom
Conversation
Closes #3 Complete Docker deployment solution with multi-stage build and security hardening: **Dockerfile** (multi-stage): - Builder stage: Compile Go binary with CGO_ENABLED=0 - Runtime stage: Minimal Alpine image (~15MB total) - Static binary with stripped debug info (-ldflags="-s -w") - Non-root user (picoclaw:picoclaw, UID:GID 1000:1000) - Security hardening: no-new-privileges, read-only filesystem - Health check endpoint: /healthz with 30s interval - Configurable port via PICOCLAW_PORT env var **docker-compose.yml**: - Single-service orchestration - Volume mounts for workspace + config + skills - Resource limits: 128MB RAM, 0.5 CPU - Automatic restart policy - Bridge network isolation **config.docker.json**: - Docker-optimized configuration - Container-friendly paths (/app/workspace, /app/skills) - JSON logging to stdout - Port 8080 exposed **.dockerignore**: - Excludes build artifacts, tests, docs - Reduces build context size - Faster docker build **README.md** (Docker section added): - Quick start guide (docker run + docker compose) - Configuration examples - Troubleshooting (5 common issues) - Feature list (security, health checks, volumes) **Features**: ✅ Binary < 10MB (stripped + optimized) ✅ Total image < 15MB (Alpine base) ✅ Configurable port (default 8080) ✅ Multi-stage build (minimal runtime image) ✅ Complete documentation **Usage**: ```bash docker build -t picoclaw:latest . docker run -p 8080:8080 -v $(pwd)/workspace:/app/workspace picoclaw:latest ``` Production-ready containerization! 🐳
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Complete Docker deployment solution for PicoClaw with multi-stage build and security hardening.
Closes #3
What's Included
✅ Dockerfile (multi-stage, 83 lines)
picoclaw:picoclaw(UID:GID 1000:1000)no-new-privileges, read-only filesystem/healthzendpoint (30s interval)PICOCLAW_PORTenv var✅ docker-compose.yml
✅ .dockerignore
✅ config.docker.json
✅ README.md (Docker section)
Requirements Met
Usage
Quick Start
Docker Compose
Security Features
✅ Non-root user (UID 1000)
✅ No new privileges
✅ Read-only filesystem (except /app/workspace)
✅ Isolated /tmp (tmpfs)
✅ Resource limits (CPU + memory)
✅ Health checks (wget on /healthz)
Image Size
Breakdown:
Configuration
Mount config at
/app/config/config.json:{ "server": { "port": 8080, "host": "0.0.0.0" }, "telegram": { "enabled": true, "bot_token": "YOUR_TOKEN" }, "storage": { "workspace_dir": "/app/workspace", "skills_dir": "/app/skills" } }Testing
Dockerfile builds successfully:
Troubleshooting
Port conflict:
Permission denied:
Container exits:
Benefits
Production-ready Docker deployment! 🐳