aboutsummaryrefslogtreecommitdiff
path: root/terraform/unifi-controller/mongo.tf
diff options
context:
space:
mode:
Diffstat (limited to 'terraform/unifi-controller/mongo.tf')
-rw-r--r--terraform/unifi-controller/mongo.tf17
1 files changed, 10 insertions, 7 deletions
diff --git a/terraform/unifi-controller/mongo.tf b/terraform/unifi-controller/mongo.tf
index 98b4e36..f7c1950 100644
--- a/terraform/unifi-controller/mongo.tf
+++ b/terraform/unifi-controller/mongo.tf
@@ -1,6 +1,6 @@
-resource "docker_network" "unifi" {
- name = "unifi"
-}
+# resource "docker_network" "unifi" {
+# name = "unifi"
+# }
data "docker_registry_image" "mongo" {
name = local.docker_image_mongo
@@ -20,19 +20,22 @@ resource "docker_container" "unifi-mongo" {
name = "unifi-mongo"
hostname = "unifi-mongo"
- networks_advanced {
- name = docker_network.unifi.name
- }
+# networks_advanced {
+# name = docker_network.unifi.name
+# }
+
+ network_mode = "host"
volumes {
volume_name = docker_volume.unifi-mongo.name
+ read_only = false
container_path = "/data/db"
}
}
output "mongo_init_js" {
sensitive = true
- value = <<-EOF
+ value = <<-EOF
db.getSiblingDB("${local.mongo_database}").
createUser({
user: "${local.mongo_database}",