Closed indierodo closed 3 months ago
@indierodo are you planning to publish your nodes to npm or using your own custom image?
Your example is using the /root path which we stopped using as we should use the node user now so your nodes should be going into /home/node/.n8n/custom
I tried a lot more stuff. It does not work.
USER: node FOLDER: /home/node/.n8n/custom
Does n8n work differently in production?
Here's the last Dockerfile:
ARG NODE_VERSION=18
FROM n8nio/base:${NODE_VERSION}
ARG N8N_VERSION=1.30.1
RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi
ENV N8N_VERSION=${N8N_VERSION}
ENV NODE_ENV=production
ENV N8N_RELEASE_TYPE=stable
RUN set -eux; \
npm install -g --omit=dev n8n@${N8N_VERSION} -- && \
npm rebuild --prefix=/usr/local/lib/node_modules/n8n sqlite3
COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh
ADD n8n-nodes-pubsubtrigger /home/node/n8n-nodes-pubsubtrigger
RUN cd /home/node/n8n-nodes-pubsubtrigger && \
npm install --include=dev && \
npm run build && \
npm link
RUN chown -R node:node /home/node
ENV SHELL /bin/sh
USER node
RUN mkdir -p /home/node/.n8n/custom && \
cd /home/node/.n8n/custom && \
npm init -y && \
npm link n8n-nodes-pubsubtrigger
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
Hey @indierodo
I guess the first thing to do is try and understand what you are actually trying to do.
Are you making a docker image to try testing your node or is this so you can deploy your node to your production environment without publishing to npm?
When your container starts does it show any errors and have you cleared the browser cache to rule out anything there?
Hi, thank you very much for your time and support.
I am trying to create a custom docker image with our private node n8n-nodes-pubsubtrigger and the n8n-nodes-python node preinstalled so I can deploy n8n in a Kubernetes environment.
Just now, I was able to pinpoint what happened:
The node was not linking properly, I was getting the 'runtime-blob-types' error referenced in issue #43
I worked around #43 by using npm install on the "nodes" folder instead of "custom" folder.
Finally, I did not clear the browser cache, this issue n8n-io/n8n#9536 helped me (sorry about not noticing earlier).
For the life of me, I've been struggling with this for days. I have tried every method described in the docs, and apparently something is happening but neither the starter or the custom node from npm appear.
I'll attach my dockerfile below. Please, if you need more information, let me know.
Thank you for your help.