This commit is contained in:
Nemo 2017-11-18 17:10:02 +05:30
parent a0722afb27
commit ed71df4792
4 changed files with 50 additions and 1 deletions

View File

@ -8,7 +8,7 @@ Manages the local infrastructure of my home server.
1. docker: to actually run the services
2. cloudflare: to manage the DNS
3. mysql: unused
3. mysql: unused, but setup
Self-learning project for terraform

View File

@ -28,4 +28,8 @@ data "docker_registry_image" "gitea" {
data "docker_registry_image" "sickrage" {
name = "linuxserver/sickrage:latest"
}
data "docker_registry_image" "airsonic" {
name = "airsonic/airsonic:latest"
}

View File

@ -36,4 +36,9 @@ resource "docker_image" "gitea" {
resource "docker_image" "sickrage" {
name = "${data.docker_registry_image.sickrage.name}"
pull_triggers = ["${data.docker_registry_image.sickrage.sha256_digest}"]
}
resource "docker_image" "airsonic" {
name = "${data.docker_registry_image.airsonic.name}"
pull_triggers = ["${data.docker_registry_image.airsonic.sha256_digest}"]
}

View File

@ -250,6 +250,46 @@ EOF
}
resource "docker_container" "airsonic" {
name = "airsonic"
image = "${docker_image.airsonic.latest}"
restart = "unless-stopped"
destroy_grace_seconds = 30
must_run = true
user = "1004"
volumes {
host_path = "/mnt/xwing/config/airsonic/data"
container_path = "/airsonic/data"
}
volumes {
host_path = "/mnt/xwing/media/Music"
container_path = "/airsonic/music"
}
volumes {
host_path = "/mnt/xwing/config/airsonic/playlists"
container_path = "/airsonic/playlists"
}
volumes {
host_path = "/mnt/xwing/config/airsonic/podcasts"
container_path = "/airsonic/podcasts"
}
labels {
"traefik.port" = 4040
"traefik.enable" = "true"
}
# ports {
# internal = 4040
# external = 4040
# }
}
resource "docker_container" "sickrage" {
name = "sickrage"
image = "${docker_image.sickrage.latest}"