Skip to content

armgit / ODS

Public Imported from GitHub
0

ODS V3 Pre-Release: Public testing and refinement ahead of the official V3 launch. Turn your PC, Mac, or Linux box into a private AI server.

2.4 KB
Raw Blame
services:
  n8n:
    image: n8nio/n8n:2.41.6@sha256:87e0bab2c93192e8dd885ff7b0697c22a1bd97489568a8c67cc140fd7dbb342d
    container_name: ods-n8n
    restart: unless-stopped
    user: "${N8N_RUN_USER:-${ODS_UID:-1000}:${ODS_GID:-1000}}"
    security_opt:
      - no-new-privileges:true
    entrypoint: ["/bin/sh", "/opt/ods/n8n-entrypoint.sh"]
    environment:
      # A host UID may not exist in the image passwd database (for example,
      # Colima's 501). The image's /home/node is not traversable by that UID;
      # keep the persistent data mount at n8n's resolved user-folder path.
      - HOME=/tmp
      - N8N_USER_FOLDER=/tmp
      # Read only by n8n-prepare.mjs, which sets n8n's owner from them where
      # no owner exists yet; n8n-entrypoint.sh unsets both before n8n starts.
      - ODS_N8N_OWNER_EMAIL=${N8N_USER:?N8N_USER must be set in .env}
      - ODS_N8N_OWNER_PASSWORD=${N8N_PASS:?N8N_PASS must be set in .env}
      - N8N_HOST=${N8N_HOST:-localhost}
      - N8N_PORT=5678
      - N8N_PROTOCOL=http
      - WEBHOOK_URL=${N8N_WEBHOOK_URL:-http://localhost:5678}
      - N8N_PROXY_HOPS=${N8N_PROXY_HOPS:-0}
      - ODS_BIND_ADDRESS=${BIND_ADDRESS:-127.0.0.1}
      - N8N_SECURE_COOKIE=${N8N_SECURE_COOKIE:-auto}
      - GENERIC_TIMEZONE=${TIMEZONE:-UTC}
      # n8n sends diagnostics and checks for new versions by default.
      - N8N_DIAGNOSTICS_ENABLED=false
      - N8N_VERSION_NOTIFICATIONS_ENABLED=false
    volumes:
      - ./extensions/services/n8n/n8n-cookie-policy.sh:/opt/ods/n8n-cookie-policy.sh:ro,z
      - ./extensions/services/n8n/n8n-entrypoint.sh:/opt/ods/n8n-entrypoint.sh:ro,z
      - ./extensions/services/n8n/n8n-prepare.mjs:/opt/ods/n8n-prepare.mjs:ro,z
      - ./data/n8n:/tmp/.n8n:z
      - ./config/n8n:/tmp/workflows:z
    ports:
      - "127.0.0.1:${N8N_PORT:-5678}:5678"
    deploy:
      resources:
        limits:
          cpus: '2.0'
          memory: 4G
        reservations:
          cpus: '0.5'
          memory: 1G
    healthcheck:
      # The image is built on a minimal base; node is the one client it is
      # guaranteed to carry.
      test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:5678/healthz').then((r) => process.exit(r.ok ? 0 : 1), () => process.exit(1))"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 30s
    logging:
      driver: "json-file"
      options:
        max-size: "10m"
        max-file: "3"