diff --git a/hass-n8n/Dockerfile b/hass-n8n/Dockerfile index 639db9f..c34cb01 100644 --- a/hass-n8n/Dockerfile +++ b/hass-n8n/Dockerfile @@ -1,9 +1,29 @@ ARG N8N_VERSION=2.1.1 -FROM docker.n8n.io/n8nio/n8n:${N8N_VERSION} -USER root -RUN apk add --no-cache --update jq bash + +# ---- builder stage ---- +FROM node:20-alpine AS builder + +RUN apk add --no-cache jq bash RUN npm install -g @anthropic-ai/claude-code + +# ---- final stage ---- +FROM docker.n8n.io/n8nio/n8n:${N8N_VERSION} + +USER root + +# jq + bash +COPY --from=builder /usr/bin/jq /usr/bin/jq +COPY --from=builder /bin/bash /bin/bash + +# global npm packages +COPY --from=builder /usr/local/lib/node_modules /usr/local/lib/node_modules +COPY --from=builder /usr/local/bin/claude /usr/local/bin/claude + +# make sure PATH sees /usr/local/bin +ENV PATH="/usr/local/bin:${PATH}" + WORKDIR /data COPY docker-entrypoint.sh /tmp/docker-entrypoint.sh -ENTRYPOINT ["bash", "/tmp/docker-entrypoint.sh"] -EXPOSE 5678/tcp \ No newline at end of file + +ENTRYPOINT ["/bin/bash", "/tmp/docker-entrypoint.sh"] +EXPOSE 5678 \ No newline at end of file