Initial commit.

This commit is contained in:
kris 2025-08-09 01:09:41 +08:00
parent 820c5f67b8
commit 7be2bd8118
No known key found for this signature in database
GPG Key ID: F632C997B5DA1A2F
3 changed files with 70 additions and 0 deletions

2
.gitignore vendored
View File

@ -0,0 +1,2 @@
.env
.env.*

45
docker-compose.yml Executable file
View File

@ -0,0 +1,45 @@
# AUTHOR: Kris <connect@kristoffermalong.dev>
# NOTE:
# Permission fix for linux based operating systems (If you are using local-space instead of mounted volumes).
# sudo chown -R 1000:1000 ./n8n_data
# sudo chmod 755 ./n8n_data
# then, restart docker compose container
# This configuration is set to mounted volume by default.
services:
n8n:
image: n8nio/n8n:stable
container_name: n8n
ports:
- "5678:5678"
user: "1000:1000"
environment:
- N8N_BASIC_AUTH_ACTIVE=${N8N_BASIC_AUTH_ACTIVE}
- N8N_BASIC_AUTH_USER=${N8N_BASIC_AUTH_USER}
- N8N_BASIC_AUTH_PASSWORD=${N8N_BASIC_AUTH_PASSWORD}
- N8N_HOST=${N8N_HOST}
- N8N_PORT=${N8N_PORT}
- N8N_PROTOCOL=${N8N_PROTOCOL}
- N8N_EDITOR_BASE_URL=${N8N_EDITOR_BASE_URL}
- TZ=${TZ}
# For security. Set default values for the following environment variables.
- N8N_RUNNERS_ENABLED=true
- N8N_ENFORCE_SETTINGS_FILE_PERMISSIONS=true
volumes:
- n8n_data:/home/node/.n8n:rw
restart: unless-stopped
# We do this since we are not autoscaling.
# We can autoscale with kubernetes or k8s in the future.
# This is to prevent your host PC or VPS from draining its resources.
deploy:
resources:
limits:
cpus: "${N8N_LIMIT_CPUS}"
memory: "${N8N_LIMIT_MEMORY}"
reservations:
cpus: "${N8N_RESERVE_CPUS}"
memory: "${N8N_RESERVE_MEMORY}"
volumes:
n8n_data:

23
env.default Normal file
View File

@ -0,0 +1,23 @@
# Rename to ".env"
# ----- System Variables
N8N_BASIC_AUTH_ACTIVE=true
N8N_BASIC_AUTH_USER=admin
N8N_BASIC_AUTH_PASSWORD=changeme
N8N_HOST=localhost
N8N_PORT=5678
N8N_PROTOCOL=http
N8N_EDITOR_BASE_URL=http://localhost:5678
TZ=Asia/Manila
# ----- Resources
# - Limits
N8N_LIMIT_CPUS=0.25
N8N_LIMIT_MEMORY=512MB
# - Reservations
N8N_RESERVE_CPUS=0.25
N8N_RESERVE_MEMORY=512MB