mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 04:04:06 -08:00
feat: Initial Dev Containers setup (no-changelog) (#8951)
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
parent
600013a1ab
commit
f7198e3734
7
.devcontainer/Dockerfile
Normal file
7
.devcontainer/Dockerfile
Normal file
|
@ -0,0 +1,7 @@
|
|||
FROM n8nio/base:20
|
||||
|
||||
RUN apk add --no-cache --update openssh sudo shadow bash
|
||||
RUN echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node && chmod 0440 /etc/sudoers.d/node
|
||||
RUN mkdir /workspaces && chown node:node /workspaces
|
||||
USER node
|
||||
RUN mkdir -p ~/.pnpm-store && pnpm config set store-dir ~/.pnpm-store --global
|
19
.devcontainer/devcontainer.json
Normal file
19
.devcontainer/devcontainer.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"name": "n8n",
|
||||
"dockerComposeFile": "docker-compose.yml",
|
||||
"service": "n8n",
|
||||
"workspaceFolder": "/workspaces",
|
||||
"mounts": [
|
||||
"type=bind,source=${localWorkspaceFolder},target=/workspaces,consistency=cached",
|
||||
"type=bind,source=${localEnv:HOME}/.ssh,target=/home/node/.ssh,consistency=cached",
|
||||
"type=bind,source=${localEnv:HOME}/.n8n,target=/home/node/.n8n,consistency=cached"
|
||||
],
|
||||
"forwardPorts": [8080, 5678],
|
||||
"postCreateCommand": "corepack prepare --activate && pnpm install ",
|
||||
"postAttachCommand": "pnpm build",
|
||||
"customizations": {
|
||||
"codespaces": {
|
||||
"openFiles": ["CONTRIBUTING.md"]
|
||||
}
|
||||
}
|
||||
}
|
23
.devcontainer/docker-compose.yml
Normal file
23
.devcontainer/docker-compose.yml
Normal file
|
@ -0,0 +1,23 @@
|
|||
volumes:
|
||||
postgres-data:
|
||||
|
||||
services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- postgres-data:/var/lib/postgresql/data
|
||||
environment:
|
||||
- POSTGRES_DB=n8n
|
||||
- POSTGRES_PASSWORD=password
|
||||
|
||||
n8n:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- ..:/workspaces:cached
|
||||
command: sleep infinity
|
||||
environment:
|
||||
DB_TYPE: postgresdb
|
||||
DB_POSTGRESDB_PASSWORD: password
|
3
.npmrc
3
.npmrc
|
@ -9,3 +9,6 @@ hoist = true
|
|||
shamefully-hoist = true
|
||||
hoist-workspace-packages = false
|
||||
loglevel = warn
|
||||
package-manager-strict=false
|
||||
# https://github.com/pnpm/pnpm/issues/7024
|
||||
package-import-method=clone-or-copy
|
||||
|
|
|
@ -9,6 +9,7 @@ Great that you are here and you want to contribute to n8n
|
|||
- [Code of conduct](#code-of-conduct)
|
||||
- [Directory structure](#directory-structure)
|
||||
- [Development setup](#development-setup)
|
||||
- [Dev Container](#dev-container)
|
||||
- [Requirements](#requirements)
|
||||
- [Node.js](#nodejs)
|
||||
- [pnpm](#pnpm)
|
||||
|
@ -60,6 +61,10 @@ The most important directories:
|
|||
If you want to change or extend n8n you have to make sure that all the needed
|
||||
dependencies are installed and the packages get linked correctly. Here's a short guide on how that can be done:
|
||||
|
||||
### Dev Container
|
||||
|
||||
If you already have VS Code and Docker installed, you can click [here](https://vscode.dev/redirect?url=vscode://ms-vscode-remote.remote-containers/cloneInVolume?url=https://github.com/n8n-io/n8n) to get started. Clicking these links will cause VS Code to automatically install the Dev Containers extension if needed, clone the source code into a container volume, and spin up a dev container for use.
|
||||
|
||||
### Requirements
|
||||
|
||||
#### Node.js
|
||||
|
|
7
n8n.code-workspace
Normal file
7
n8n.code-workspace
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"folders": [
|
||||
{
|
||||
"path": ".",
|
||||
},
|
||||
],
|
||||
}
|
Loading…
Reference in a new issue