This repository was archived by the owner on May 24, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (45 loc) · 1.92 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (45 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# OpenClaw Docker Image
# Uses pre-built base image for fast builds
# Base image contains: apt packages, pnpm, mcporter, sag, playwright/chromium
#
# To build locally without registry access, first build the base:
# docker build -f Dockerfile.base -t ghcr.io/zot24/openclaw-base:latest .
ARG BASE_IMAGE=ghcr.io/zot24/openclaw-base:latest
# =============================================================================
# Stage 1: Builder
# Clone and build OpenClaw
# =============================================================================
FROM ${BASE_IMAGE} AS builder
WORKDIR /app
# Clone OpenClaw repository
ARG OPENCLAW_VERSION=main
RUN git clone --depth 1 --branch ${OPENCLAW_VERSION} https://github.com/openclaw/openclaw.git .
# Install dependencies and build
RUN pnpm install --frozen-lockfile || pnpm install
RUN pnpm build && pnpm ui:build
# =============================================================================
# Stage 2: Runtime
# Final image with built application
# =============================================================================
FROM ${BASE_IMAGE} AS runtime
WORKDIR /app
# Copy built application from builder with correct ownership
COPY --from=builder --chown=openclaw:openclaw /app /app
# Create data directories
RUN mkdir -p /home/openclaw/.openclaw /home/openclaw/clawd \
&& chown -R openclaw:openclaw /home/openclaw/.openclaw /home/openclaw/clawd
# Copy entrypoint script
COPY --chown=openclaw:openclaw entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Expose ports
EXPOSE 18789 18790
# Set environment
ENV NODE_ENV=production
ENV HOME=/home/openclaw
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:18789/ || exit 1
# Start as root - entrypoint fixes volume permissions then drops to openclaw user
# This is required for Umbrel where Docker creates volume dirs as root
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gateway"]