Deploy a docker compose project to a Google Cloud Compute Instance.
| Name | Version |
|---|---|
| terraform | >= 1.2.4 |
| ~> 7.0 |
| Name | Version |
|---|---|
| cloudinit | 2.3.7 |
| 7.12.0 | |
| time | n/a |
| Name | Source | Version |
|---|---|---|
| ppb | git::https://github.com/libops/terraform-cloudrun-v2 | 0.5.0 |
| Name | Description | Type | Default | Required |
|---|---|---|---|---|
| docker_compose_repo | git repo to checkout that contains a docker compose project | string |
n/a | yes |
| name | The site name (will be the name of the GCP instance) | string |
n/a | yes |
| project_id | The GCP project ID | string |
n/a | yes |
| project_number | The GCP project number | string |
n/a | yes |
| allowed_ips | CIDR IP Addresses allowed to turn on this site's GCP instance | list(string) |
[] |
no |
| allowed_ssh_ipv4 | CIDR IPv4 Addresses allowed to to SSH into this site's GCP instance | list(string) |
[] |
no |
| allowed_ssh_ipv6 | CIDR IPv6 Addresses allowed to SSH into this site's GCP instance | list(string) |
[] |
no |
| disk_size_gb | Data disk size in GB | number |
50 |
no |
| docker_compose_branch | git branch to checkout for var.docker_compose_repo | string |
"main" |
no |
| docker_compose_down | Command to stop the docker compose project | string |
"docker compose down" |
no |
| docker_compose_init | After cloning the docker compose git repo, any initialization that needs to happen before the docker compose project can start | string |
"" |
no |
| docker_compose_up | Command to start the docker compose project | string |
"docker compose up --remove-orphans" |
no |
| machine_type | VM machine type (General-purpose series that support Hyperdisk Balanced | string |
"n4-standard-2" |
no |
| os | The host OS to install on the GCP instance | string |
"cos-125-19216-104-25" |
no |
| overlay_source_instance | Name of production instance to get latest snapshot from (e.g., 'ojs-production'). Terraform will automatically use the most recent snapshot from this instance's data disk. Leave empty for production environments. | string |
"" |
no |
| region | GCP region for resources | string |
"us-east5" |
no |
| rootfs | Path to additional rootfs files to copy into the VM. Files will be merged with the base rootfs. Example: '../platform/terraform/rootfs' | string |
"" |
no |
| run_snapshots | Enable daily snapshots of the data disk (recommended for production). Last seven days of snapshots are available. Also weekly snapshots for past year. | bool |
false |
no |
| runcmd | Additional commands to run during cloud-init. Commands are executed after the main initialization. | list(string) |
[] |
no |
| users | Map of usernames to lists of SSH public keys. Users will be created with docker group membership. Example: { "alice" = ["ssh-rsa AAAA..."], "bob" = ["ssh-ed25519 AAAA...", "ssh-rsa BBBB..."] } | map(list(string)) |
{} |
no |
| volume_names | List of docker volumes to overlay from production snapshot (e.g., ['compose_ojs-public']). Production data is mounted read-only as lower layer, staging writes go to upper layer. | list(string) |
[] |
no |
| zone | GCP zone for resources | string |
"us-east5-b" |
no |
| Name | Description |
|---|---|
| appGsa | The Google Service Account the app can leverage to auth to other Google services |
| instance | The Google Compute instance ID, name, zone, data disk, GSA for the instance. |
| serviceGsa | The Google Service Account internal services that manage the VM runs as |