mirror of
https://github.com/n8n-io/n8n-nodes-starter.git
synced 2025-11-12 11:27:28 -06:00
Add first docker and docker-compose support
This commit is contained in:
parent
c1320ac047
commit
bec242d841
5 changed files with 46 additions and 1 deletions
1
.env
Normal file
1
.env
Normal file
|
|
@ -0,0 +1 @@
|
|||
GENERIC_TIMEZONE=UTC
|
||||
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
FROM docker.n8n.io/n8nio/n8n:latest AS target
|
||||
|
||||
FROM node:19-alpine AS build
|
||||
RUN npm i npm@latest -g
|
||||
WORKDIR /build
|
||||
COPY . .
|
||||
|
||||
RUN npm run build
|
||||
|
||||
FROM target as final
|
||||
WORKDIR /custom-nodes
|
||||
|
||||
COPY --from=build /build .
|
||||
COPY --from=build /build/run.sh /run.sh
|
||||
|
||||
WORKDIR /custom-nodes
|
||||
USER root
|
||||
RUN npm link
|
||||
|
||||
USER node
|
||||
ENTRYPOINT [ "tini", "--", "/run.sh" ]
|
||||
|
|
@ -31,7 +31,7 @@ These are the basic steps for working with the starter. For detailed guidance on
|
|||
3. Run `npm i` to install dependencies.
|
||||
4. Open the project in your editor.
|
||||
5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes.
|
||||
6. Update the `package.json` to match your details.
|
||||
6. Update the `package.json` to match your details. Also update the `run.sh` with your package (In `package.json` => "name") name.
|
||||
7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible.
|
||||
8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance.
|
||||
9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started.
|
||||
|
|
|
|||
18
docker-compose.yml
Normal file
18
docker-compose.yml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
version: "3"
|
||||
|
||||
services:
|
||||
n8n:
|
||||
image: n8n-custom-nodes
|
||||
restart: unless-stopped
|
||||
build: .
|
||||
ports:
|
||||
- "5678:5678"
|
||||
environment:
|
||||
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
|
||||
- N8N_LOG_LEVEL=debug
|
||||
volumes:
|
||||
- n8n-data:/home/node/.n8n
|
||||
|
||||
volumes:
|
||||
n8n-data:
|
||||
name: n8n-data
|
||||
5
run.sh
Normal file
5
run.sh
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/bin/sh
|
||||
mkdir -p ~/.n8n/nodes/
|
||||
cd ~/.n8n/nodes/
|
||||
npm link n8n-nodes-<...>
|
||||
/docker-entrypoint.sh
|
||||
Loading…
Add table
Add a link
Reference in a new issue