Skip to content

Add Terraform deployment example#31

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-terraform-equivalent-examples
Open

Add Terraform deployment example#31
Copilot wants to merge 4 commits intomainfrom
copilot/add-terraform-equivalent-examples

Conversation

Copy link

Copilot AI commented Dec 9, 2025

Adds Terraform configuration equivalent to existing docker-compose, helm, azure-container-apps, and unraid examples for deploying ServiceControl platform components.

Implementation

  • terraform/main.tf: Provisions 6 containers (servicecontrol, servicecontrol-audit, servicecontrol-monitoring, servicepulse, servicecontrol-ravendb, rabbitmq) using Docker provider with proper dependencies, health checks, and networking
  • terraform/variables.tf: Configurable image tags, ports, transport settings, and license
  • terraform/outputs.tf: Service URLs for quick access
  • terraform/README.md: Usage instructions covering init/plan/apply lifecycle, port configuration, and troubleshooting
  • terraform/.gitignore: Standard Terraform exclusions
  • terraform/terraform.tfvars.example: Configuration template

Key Details

  • Internal container ports (33333, 44444, 33633, 8080) are fixed in environment variables as required by the images, independent of external port mappings
  • RavenDB health check uses built-in /usr/lib/ravendb/scripts/healthcheck.sh from the official image
  • Docker network isolates service communication; persistent volumes for RabbitMQ and RavenDB data

Example deployment:

terraform init
terraform apply
# Access ServicePulse at http://localhost:9090

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • checkpoint-api.hashicorp.com
    • Triggering command: /usr/local/bin/terraform terraform version (dns block)
    • Triggering command: /usr/local/bin/terraform terraform init (dns block)
    • Triggering command: /usr/local/bin/terraform terraform validate (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Create a terraform equivalent to the AKS, docker compose, helm and unraid examples that is present in this repo


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 9, 2025 09:29
Co-authored-by: andreasohlund <125028+andreasohlund@users.noreply.github.com>
Co-authored-by: andreasohlund <125028+andreasohlund@users.noreply.github.com>
Co-authored-by: andreasohlund <125028+andreasohlund@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Terraform equivalent examples for AKS, Docker Compose, Helm, and Unraid Add Terraform deployment example Dec 9, 2025
Copilot AI requested a review from andreasohlund December 9, 2025 09:37
@andreasohlund
Copy link
Member

Tested locally and runs fine on my mac

@andreasohlund andreasohlund marked this pull request as ready for review December 9, 2025 14:45
name = docker_network.service_platform.name
}

ports {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it intended to bind to 0.0.0.0 for all the port exposures? I guess we should bind to the local NIC. Espcially if we use default username and/or password.

@@ -0,0 +1,34 @@
output "servicepulse_url" {
description = "URL for ServicePulse web interface"
value = "http://localhost:${var.servicepulse_port}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

localhost can be resolved to IPv4 or IPv6. Does it matter in this case? Shouldn't we bind explicitly to either of these?

variable "docker_host" {
description = "Docker daemon host (e.g., unix:///var/run/docker.sock for local, or tcp://host:2376 for remote)"
type = string
default = "unix:///var/run/docker.sock"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this compatible with docker running in WSL? I'm not sure if docker in WSL exposes the TCP socket out of the box. Might be worth adding a note for that.

default = "latest"
}

variable "transport_type" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we could add validation to this variable. hashicorp/terraform#25283

default = "RabbitMQ.QuorumConventionalRouting"
}

variable "connection_string" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be marked as sensitive.

}

# RabbitMQ container
resource "docker_image" "rabbitmq" {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this resource should be optional. I can imagine someone willing to run SC + SP with their own transport.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants