Skip to content

Latest commit

 

History

History
44 lines (34 loc) · 2.44 KB

File metadata and controls

44 lines (34 loc) · 2.44 KB

Project Overview

The project automates the deployment of an n8n instance on the Google Cloud Platform (GCP). It uses a combination of shell scripts and Docker Compose to provision the infrastructure and configure the application.

  • provision-cloud.sh: This is the main script that orchestrates the deployment. It runs on the user's local machine and uses the gcloud CLI to:
    • Prompt the user for GCP project details and a domain name.
    • Provision a static IP address, a firewall rule, and a Compute Engine VM.
    • Copy the configuration templates and the setup script to the VM.
    • Execute the setup script on the VM.
  • setup-instance.sh: This script runs on the newly created VM and does the following:
    • Installs Docker and Docker Compose.
    • Sets up the application directory.
    • Configures the Caddyfile and .env files with the user-provided domain name.
    • Starts the n8n and Caddy containers using Docker Compose.
  • templates/: This directory contains the configuration files:
    • docker-compose.yml: Defines the n8n and caddy services.
    • Caddyfile: Configures Caddy as a reverse proxy with automatic HTTPS.
    • .env: Contains the environment variables for the n8n application.

Building and Running

The project is not "built" in a traditional sense. It is "run" to deploy the n8n application.

Prerequisites:

  • Google Cloud SDK (gcloud) installed and configured.
  • A GCP project with billing enabled and necessary permissions.
  • A registered domain name.

To run the deployment:

  1. Clone the repository.
  2. Execute the provision-cloud.sh script:
    bash provision-cloud.sh
  3. Follow the interactive prompts.
  4. Update the DNS A record for the domain as instructed by the script.

Development Conventions

  • Separation of Concerns: The deployment process is split into two scripts: provision-cloud.sh for local orchestration and setup-instance.sh for remote configuration. This makes the process more modular and easier to debug.
  • Templating: The configuration files in the templates directory use placeholders (e.g., __DOMAIN_NAME__) that are dynamically replaced by the setup-instance.sh script. This allows for easy customization of the deployment.
  • Automation: The entire process, from infrastructure provisioning to application deployment, is automated, requiring minimal user intervention.