I’ve got an issue with my custom node deployment in docker.
I put the Nodes and Credentials folder into the custom folder in the docker container. And it does not start anymore. giving the error:
I’ve read the post thread https://community.n8n.io/t/how-to-add-new-node-in-a-production-setup/7007/32
But it seems like the solution would be to just disable the import, that does not seem like a good solution.
Not sure what the absolute path is of ‘n8n-workflow’
I am importing : import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
Hope there is an easy way to fix this.
I’ve also created a new node module, but still figuring out why it doesn’t want to build the docker image (using Git actions)
Information on your n8n setup
n8n version: latest
Database you’re using (default: SQLite): SQLite
Running n8n with the execution process [own(default), main]: own
Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker
Hey @BramKn, I am so sorry to hear you’re having trouble. I too failed at building a custom docker images in the past, so can’t offer any useful advice here unfortunately
So my personal advice here would be to wait until the community node repo feature is rolled out or to avoid using a custom image right now and go for the documented route based on our standard image instead:
As soon as I add the line to add the custom module. It returns an error. buildx failed with: error: failed to solve: process "/bin/sh -c cd /usr/local/lib/node_modules/n8n && npm install n8n-nodes-caspio" did not complete successfully: exit code: 2
Any idea how to fix this?
when not using the custom but normal dockerfile it gives the error:
build
buildx failed with: error: failed to solve: failed to compute cache key: failed to calculate checksum of ref q1n0028o4yq0tl9keue6w22gp::0z98lp46m0k302gr7fpc583tg: "/docker-entrypoint.sh": not found
trying to build with GitHub actions.
Without this line to add the module it does work as expected.
So I just gave this a go (on my Windows machine even) with a Dockerfile like this:
FROM node:16-alpine
ARG N8N_VERSION
RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi
# Update everything and install needed dependencies
RUN apk add --update graphicsmagick tzdata git tini su-exec
# # Set a custom user to not have n8n run as root
USER root
# Install n8n and the also temporary all the packages
# it needs to build it correctly.
RUN apk --update add --virtual build-dependencies python3 build-base ca-certificates && \
npm config set python "$(which python3)" && \
npm_config_user=root npm install -g full-icu n8n@${N8N_VERSION} && \
apk del build-dependencies \
&& rm -rf /root /tmp/* /var/cache/apk/* && mkdir /root;
# Install n8n-nodes-weather module
RUN cd /usr/local/lib/node_modules/n8n && npm install n8n-nodes-caspio
# Install fonts
RUN apk --no-cache add --virtual fonts msttcorefonts-installer fontconfig && \
update-ms-fonts && \
fc-cache -f && \
apk del fonts && \
find /usr/share/fonts/truetype/msttcorefonts/ -type l -exec unlink {} \; \
&& rm -rf /root /tmp/* /var/cache/apk/* && mkdir /root
ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu
WORKDIR /data
COPY docker-entrypoint.sh /docker-entrypoint.sh
ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"]
EXPOSE 5678/tcp
I also copied thisdocker-entrypoint.sh file to the same directory as my Dockerfile and have used docker build --build-arg N8N_VERSION=0.177.0 --tag=n8ntestbram . as my build command. This seems to work fine and I do have access to your node now:
@MutedJam Thanks! I am working on it. Apparently I also have a very old version of docker which could have been one of the problems.
Ill keep you updated.
It Works, thanks A LOT.
The real problem was the docker desktop version, which was way too old. Apparently, time flies and I didn’t notice the version being all messed-up.
Awesome, glad to hear this works! Our documentation here also needs an update, so I suppose old docker version + old documentation isn’t a great combination
Hey @ChristianV
If the Dist folder is missing, then this is probably in the .gitignore and simply not on GIT. you do need this though, so changing the gitignore might be the only fix you need.
This is the folder where the build nodes and credentials are stored.