mirror of
https://github.com/vhaudiquet/homeprod.git
synced 2025-12-19 04:26:04 +00:00
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
This commit is contained in:
39
infra/pve/docker/main.tf
Normal file
39
infra/pve/docker/main.tf
Normal file
@@ -0,0 +1,39 @@
|
||||
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 ]
|
||||
}
|
||||
Reference in New Issue
Block a user