-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile.nullclaw-base
More file actions
71 lines (64 loc) · 2.25 KB
/
Dockerfile.nullclaw-base
File metadata and controls
71 lines (64 loc) · 2.25 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
# Base image for nullclaw agents (test stub).
# Usage: docker build -t nullclaw:latest -f Dockerfile.nullclaw-base .
#
# NullClaw is a fictional test runtime. This stub provides a minimal HTTP
# health endpoint on :3000 and cron subcommands for driver integration testing.
FROM alpine:3.20
RUN apk add --no-cache curl jq tini python3
# Stub binary: health endpoint + cron commands + agent invocation
COPY <<'STUB' /usr/local/bin/nullclaw
#!/bin/sh
set -eu
cmd="${1:-run}"
case "$cmd" in
run)
mkdir -p /tmp/nullclaw-spike
printf "ok\n" >/tmp/nullclaw-spike/health
exec python3 -m http.server 3000 --directory /tmp/nullclaw-spike
;;
cron)
sub="${2:-}"
case "$sub" in
list)
jobs_file=/tmp/nullclaw-spike/cron.jobs
count=0
if [ -f "$jobs_file" ]; then count="$(wc -l <"$jobs_file" | tr -d ' ')"; fi
echo "info(cron): Scheduled jobs (${count}):"
if [ -f "$jobs_file" ]; then
i=0
while IFS="$(printf '\t')" read -r expr command; do
[ -n "${expr:-}" ] || continue
i=$((i + 1))
echo "info(cron): - job-${i} | ${expr} | next=0 | status=n/a cmd: ${command}"
done <"$jobs_file"
fi
;;
add)
[ "$#" -ge 4 ] || { echo "error: usage: nullclaw cron add '<schedule>' '<command>'" >&2; exit 2; }
mkdir -p /tmp/nullclaw-spike
printf "%s\t%s\n" "$3" "$4" >>/tmp/nullclaw-spike/cron.jobs
echo "info(cron): added schedule '$3'"
;;
*) echo "error: unknown nullclaw cron subcommand '$sub'" >&2; exit 2 ;;
esac
;;
agent)
[ "${2:-}" = "-m" ] && { echo "nullclaw agent: ${3:-}"; exit 0; }
echo "error: usage: nullclaw agent -m <message>" >&2; exit 2
;;
*) echo "error: unknown nullclaw subcommand '$cmd'" >&2; exit 2 ;;
esac
STUB
RUN chmod +x /usr/local/bin/nullclaw
COPY discord-responder.sh /usr/local/bin/discord-responder
RUN chmod +x /usr/local/bin/discord-responder
# Entrypoint wrapper: start Discord responder in background, then run main process
COPY <<'WRAPPER' /usr/local/bin/nullclaw-entrypoint
#!/bin/sh
/usr/local/bin/discord-responder &
exec nullclaw run
WRAPPER
RUN chmod +x /usr/local/bin/nullclaw-entrypoint
EXPOSE 3000
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["nullclaw-entrypoint"]