Skip to content

Commit

Permalink
Add first docker and docker-compose support
Browse files Browse the repository at this point in the history
  • Loading branch information
solvingproblemswithtechnology committed Aug 14, 2023
1 parent c1320ac commit bec242d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GENERIC_TIMEZONE=UTC
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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 changes: 5 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
mkdir -p ~/.n8n/nodes/
cd ~/.n8n/nodes/
npm link n8n-nodes-<...>
/docker-entrypoint.sh

0 comments on commit bec242d

Please sign in to comment.