Skip to content

Commit

Permalink
Merge pull request #80 from code0-tech/safeguard-against-non-existent…
Browse files Browse the repository at this point in the history
…-images

Add protection against non-existing docker images with data sources
  • Loading branch information
Taucher2003 authored Oct 26, 2024
2 parents fb4d50e + 1b5434f commit b7ab48b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 9 deletions.
56 changes: 48 additions & 8 deletions modules/docker/plane/images.tf
Original file line number Diff line number Diff line change
@@ -1,31 +1,71 @@
resource "docker_image" "plane_frontend" {
data "docker_registry_image" "plane_frontend" {
name = "makeplane/plane-frontend:v0.22-dev"
}

resource "docker_image" "plane_space" {
resource "docker_image" "plane_frontend" {
name = data.docker_registry_image.plane_frontend.name
pull_triggers = [data.docker_registry_image.plane_frontend.sha256_digest]
}

data "docker_registry_image" "plane_space" {
name = "makeplane/plane-space:v0.22-dev"
}

resource "docker_image" "plane_admin" {
resource "docker_image" "plane_space" {
name = data.docker_registry_image.plane_space.name
pull_triggers = [data.docker_registry_image.plane_space.sha256_digest]
}

data "docker_registry_image" "plane_admin" {
name = "makeplane/plane-admin:v0.22-dev"
}

resource "docker_image" "plane_backend" {
resource "docker_image" "plane_admin" {
name = data.docker_registry_image.plane_admin.name
pull_triggers = [data.docker_registry_image.plane_admin.sha256_digest]
}

data "docker_registry_image" "plane_backend" {
name = "makeplane/plane-backend:v0.22-dev"
}

resource "docker_image" "plane_proxy" {
resource "docker_image" "plane_backend" {
name = data.docker_registry_image.plane_backend.name
pull_triggers = [data.docker_registry_image.plane_backend.sha256_digest]
}

data "docker_registry_image" "plane_proxy" {
name = "makeplane/plane-proxy:v0.22-dev"
}

resource "docker_image" "postgres" {
resource "docker_image" "plane_proxy" {
name = data.docker_registry_image.plane_proxy.name
pull_triggers = [data.docker_registry_image.plane_proxy.sha256_digest]
}

data "docker_registry_image" "postgres" {
name = "postgres:15.7-alpine"
}

resource "docker_image" "valkey" {
resource "docker_image" "postgres" {
name = data.docker_registry_image.postgres.name
pull_triggers = [data.docker_registry_image.postgres.sha256_digest]
}

data "docker_registry_image" "valkey" {
name = "valkey/valkey:7.2.5-alpine"
}

resource "docker_image" "minio" {
resource "docker_image" "valkey" {
name = data.docker_registry_image.valkey.name
pull_triggers = [data.docker_registry_image.valkey.sha256_digest]
}

data "docker_registry_image" "minio" {
name = "minio/minio:RELEASE.2024-07-10T18-41-49Z"
}

resource "docker_image" "minio" {
name = data.docker_registry_image.minio.name
pull_triggers = [data.docker_registry_image.minio.sha256_digest]
}
7 changes: 6 additions & 1 deletion modules/docker/proxy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,15 @@ terraform {
}
}

resource "docker_image" "proxy" {
data "docker_registry_image" "proxy" {
name = "nginxproxy/nginx-proxy:1.6.3"
}

resource "docker_image" "proxy" {
name = data.docker_registry_image.proxy.name
pull_triggers = [data.docker_registry_image.proxy.sha256_digest]
}

resource "docker_network" "proxy" {
name = "proxy"
attachable = true
Expand Down

0 comments on commit b7ab48b

Please sign in to comment.