Created
November 7, 2019 03:14
-
-
Save adowning/eca3035d090442602f61c3eb4b2f62f1 to your computer and use it in GitHub Desktop.
n8n install
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| apt update | |
| apt install apt-transport-https ca-certificates curl software-properties-common | |
| curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" | |
| apt update | |
| apt install docker-ce -y | |
| curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
| chmod +x /usr/local/bin/docker-compose | |
| DATA_FOLDER=/root/n8n/ | |
| # The top level domain to serve from | |
| DOMAIN_NAME=dev.ashdevtools.com | |
| GENERIC_TIMEZONE=America/Chicago | |
| # The subdomain to serve from | |
| SUBDOMAIN=n8n | |
| echo ' | |
| version: "3" | |
| services: | |
| traefik: | |
| image: "traefik" | |
| command: | |
| - "--api=true" | |
| - "--api.insecure=true" | |
| # - "--providers.docker=true" | |
| # - "--providers.docker.exposedbydefault=true" | |
| - "--entrypoints.websecure.address=:80" | |
| # - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true" | |
| # - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}" | |
| # - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" | |
| ports: | |
| # - "443:443" | |
| - "80:80" | |
| volumes: | |
| # - ${DATA_FOLDER}/letsencrypt:/letsencrypt | |
| - /var/run/docker.sock:/var/run/docker.sock:ro | |
| n8n: | |
| image: n8nio/n8n | |
| ports: | |
| - "5678:5678" | |
| labels: | |
| - traefik.enable=true | |
| - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`) | |
| - traefik.http.routers.n8n.tls=false | |
| - traefik.http.routers.n8n.entrypoints=websecure | |
| # - traefik.http.routers.n8n.tls.certresolver=mytlschallenge | |
| # - traefik.http.middlewares.n8n.headers.SSLRedirect=true | |
| # - traefik.http.middlewares.n8n.headers.STSSeconds=315360000 | |
| # - traefik.http.middlewares.n8n.headers.browserXSSFilter=true | |
| # - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true | |
| # - traefik.http.middlewares.n8n.headers.forceSTSHeader=true | |
| # - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME} | |
| # - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true | |
| # - traefik.http.middlewares.n8n.headers.STSPreload=true | |
| environment: | |
| - N8N_BASIC_AUTH_ACTIVE=false | |
| # - N8N_BASIC_AUTH_USER | |
| # - N8N_BASIC_AUTH_PASSWORD | |
| - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME} | |
| - N8N_PORT=5678 | |
| - N8N_PROTOCOL=http | |
| - NODE_ENV=development | |
| - WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/ | |
| - VUE_APP_URL_BASE_API=http://${SUBDOMAIN}.${DOMAIN_NAME}/ | |
| volumes: | |
| - /var/run/docker.sock:/var/run/docker.sock | |
| - ${DATA_FOLDER}/.n8n:/root/.n8n' >> $DATA_FOLDER/docker-compose.yml | |
| ' >> $DATA_FOLDER/docker-compose.yml | |
| # Optional timezone to set which gets used by Cron-Node by default | |
| # If not set New York time will be used | |
| # The email address to use for the SSL certificate creation | |
| SSL_EMAIL=ashdowning@gmail.com | |
| mkdir /root/n8n/ | |
| 8. Start docker-compose setup | |
| n8n can now be started via: | |
| sudo /exe/n8n/docker-compose up -d | |
| #In case it should ever be stopped that can be done with this command: | |
| #sudo docker-compose stop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment