I’ve created a new endpoint locally in the project. But each time I build the docker image and run locally the new code I’ve written doesn’t appear. For example, I’ve tried to add a console.log statement to the existing /rest/node-types endpoint and the log is never outputted.
I added a log statement in the following endpoint in Server.ts but the log is never outputted:
You will see that it gets the n8n code from npm and so has nothing to do with the files you have locally at all. You would have to create totally different Dockerfile.
The Dockerfile you need would have to copy in your local code and then run npm install in the container. If you only want to make changes to n8n-cli it should be quite simple. If you also want to make changes to the other modules it would get more complicated as you would then have to have the lerna-setup in the docker container.
But one question. What do you want to do exactly? Like do you want to develop for n8n or do you want to make changes and then really run it like that long term?
Just looking to host a slightly modified version of n8n on my own server for a personal project.
I tried creating the following Dockerfile but am getting errors:
FROM node:10
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
EXPOSE 5678
CMD npm start
Each time this outputs the following:
> [email protected] start /usr/src/app
> run-script-os
> [email protected] start:default /usr/src/app
> cd bin && ./n8n
› Error: command start not found
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start:default: `cd bin && ./n8n`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start:default script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2019-11-25T00_45_14_196Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! [email protected] start: `run-script-os`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
For now just in the n8n-cli. Eventually I might make some modifications to the web client. Can you suggest how to make the dockerfile work so I can run the n8n-cli locally? Thank you.