Files
homeprod/infra/pve/docker/main.tf
vhaudiquet d5a7de4037 Big infrastructure changes
- Switch to .lan everywhere for Kubernetes
- Updates on providers and images
- Update docker machine to directly work with SwarmCD
- Add docker provider for Terraform to install SwarmCD
2025-09-16 18:33:52 +02:00

40 lines
827 B
HCL

terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "3.6.2"
}
}
}
# Docker configuration
provider "docker" {
host = "ssh://root@docker-machine.lan"
}
resource "docker_image" "swarm-cd" {
name = "ghcr.io/m-adawi/swarm-cd:latest"
}
resource "docker_container" "swarm-cd" {
name = "swarm-cd"
image = docker_image.swarm-cd.image_id
volumes {
host_path = "/var/run/docker.sock"
container_path = "/var/run/docker.sock"
read_only = true
}
volumes {
host_path = "/root/homeprod/.swarmcd/repos.yaml"
container_path = "/app/repos.yaml"
read_only = true
}
volumes {
host_path = "/root/homeprod/.swarmcd/stacks.yaml"
container_path = "/app/stacks.yaml"
read_only = true
}
depends_on = [ docker_image.swarm-cd ]
}