-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
80 lines (71 loc) · 2.8 KB
/
Copy pathDockerfile
File metadata and controls
80 lines (71 loc) · 2.8 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
FROM golang:1.26.2-trixie AS build
WORKDIR /src
ARG TARGETOS=linux
ARG TARGETARCH=amd64
ARG GIT_CHANGES_BY_DAY_VERSION=latest
COPY go.mod ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GOBIN=/out \
go install github.com/moltenbot000/git-changes-by-day@${GIT_CHANGES_BY_DAY_VERSION}
COPY . .
RUN --mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} \
go build -trimpath -ldflags="-s -w" -o /out/harness ./cmd/harness
FROM node:25.9.0-trixie-slim AS runtime
ENV GIT_TERMINAL_PROMPT=0 \
HARNESS_AGENT_HARNESS="" \
HARNESS_AGENT_COMMAND="" \
HARNESS_AGENTS_SEED_PATH=/opt/moltenhub/library/AGENTS.md \
HARNESS_WORKSPACE_RAM_BASE=/workspace \
HARNESS_WORKSPACE_DISK_BASE=/workspace \
HOME=/workspace/config/home \
NODE_PATH=/usr/local/lib/node_modules \
PLAYWRIGHT_BROWSERS_PATH=/opt/ms-playwright \
PLAYWRIGHT_SKIP_BROWSER_GC=1 \
PATH="/usr/local/go/bin:${PATH}"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
file \
git \
gh \
jq \
openssh-client \
python3-pip \
python3-venv \
python3 \
ripgrep \
&& ln -sf /usr/bin/python3 /usr/local/bin/python \
&& ln -sf /usr/bin/pip3 /usr/local/bin/pip \
&& python3 -m pip install --no-cache-dir --break-system-packages --root-user-action=ignore --upgrade openai \
&& npm install --global \
@openai/codex@latest \
@anthropic-ai/claude-code@latest \
@moltenbot/railsmith@latest \
playwright@latest \
@playwright/test@latest \
&& playwright install --with-deps chromium \
&& npm cache clean --force \
&& rm -rf /var/lib/apt/lists/* /tmp/* \
&& mkdir -p /workspace/config/home /workspace/moltenhub-code/tasks \
&& chown -R node:node /workspace /opt/ms-playwright
WORKDIR /workspace
COPY --from=build --chmod=755 /out/harness /usr/local/bin/harness
COPY --from=build --chmod=755 /out/git-changes-by-day /usr/local/bin/git-changes-by-day
COPY --from=build /usr/local/go /usr/local/go
COPY library /opt/moltenhub/library
COPY skills /opt/moltenhub/skills
COPY --chmod=755 docker/entrypoint.sh /usr/local/bin/entrypoint
COPY --chmod=755 docker/with-config.sh /usr/local/bin/with-config
RUN ln -sf /usr/local/go/bin/go /usr/local/bin/go \
&& ln -sf /usr/local/go/bin/gofmt /usr/local/bin/gofmt \
&& ln -s /opt/moltenhub/library /workspace/library \
&& ln -s /opt/moltenhub/skills /workspace/skills
VOLUME ["/workspace/config"]
USER node
ENTRYPOINT ["/usr/local/bin/entrypoint"]
CMD ["/usr/local/bin/with-config"]