-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (27 loc) · 1.06 KB
/
Dockerfile
File metadata and controls
39 lines (27 loc) · 1.06 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
# Global ARG for use in FROM instructions
ARG OPENCLAW_VERSION=latest
# Build Go proxy
FROM golang:1.22-bookworm AS proxy-builder
WORKDIR /proxy
COPY proxy/ .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /proxy-bin .
# Extend pre-built OpenClaw with our auth proxy
FROM ghcr.io/openclaw/openclaw:${OPENCLAW_VERSION}
# Base image ends with USER node; switch to root for setup
USER root
# Add packages for openclaw agent operations
RUN apt-get update && apt-get install -y --no-install-recommends \
ripgrep \
&& rm -rf /var/lib/apt/lists/*
# Add proxy
COPY --from=proxy-builder /proxy-bin /usr/local/bin/proxy
# Create CLI wrapper (openclaw code is at /app/dist/index.js in base image)
RUN printf '#!/bin/sh\nexec node /app/dist/index.js "$@"\n' > /usr/local/bin/openclaw \
&& chmod +x /usr/local/bin/openclaw
# Gateway is Node; match render.yaml / NODE_OPTIONS (override via Render env).
ENV NODE_OPTIONS="--max-old-space-size=3072"
ENV PORT=10000
EXPOSE 10000
# Run as non-root for security (matching base image)
USER node
CMD ["/usr/local/bin/proxy"]