-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (28 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
44 lines (28 loc) · 1.17 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
# syntax=docker/dockerfile:1
FROM alpine:3.23 AS builder
RUN apk add --no-cache zig musl-dev ca-certificates curl git
WORKDIR /app
RUN git clone --depth 1 https://github.com/nullclaw/nullclaw.git .
RUN set -eu; \
case "$(uname -m)" in \
x86_64) zig_target="x86_64-linux-musl" ;; \
aarch64|arm64) zig_target="aarch64-linux-musl" ;; \
*) echo "Unsupported arch: $(uname -m)" >&2; exit 1 ;; \
esac; \
zig build -Dtarget="${zig_target}" -Doptimize=ReleaseSmall
FROM alpine:3.23 AS release
LABEL org.opencontainers.image.source=https://github.com/nullclaw/nullclaw
RUN apk add --no-cache ca-certificates curl tzdata
RUN mkdir -p /nullclaw-data/.nullclaw /nullclaw-data/workspace
COPY --from=builder /app/zig-out/bin/nullclaw /usr/local/bin/nullclaw
COPY config.template.json /app/config.template.json
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV NULLCLAW_WORKSPACE=/nullclaw-data/workspace
ENV HOME=/nullclaw-data
WORKDIR /nullclaw-data
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD wget -qO- http://localhost:${PORT:-3000}/health || exit 1
ENTRYPOINT ["/entrypoint.sh"]
CMD ["gateway"]