-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpostgres.tf
40 lines (31 loc) · 1010 Bytes
/
postgres.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
data "docker_registry_image" "postgres" {
name = "postgres:11-alpine"
}
resource "docker_image" "postgres" {
name = "${data.docker_registry_image.postgres.name}"
pull_triggers = ["${data.docker_registry_image.postgres.sha256_digest}"]
}
resource "docker_container" "postgres" {
name = "postgres"
image = "${docker_image.postgres.name}"
hostname = "postgresdb"
volumes {
host_path = "${var.mount_point}/db/postgres"
container_path = "/var/lib/postgresql/data"
}
upload {
content = "${file("${path.module}/conf/gitea.sql")}"
file = "/docker-entrypoint-initdb.d/gitea.sql"
}
upload {
content = "${file("${path.module}/conf/wikijs.sql")}"
file = "/docker-entrypoint-initdb.d/wikijs.sql"
}
env = [
"POSTGRES_USER=${var.postgres_username}",
"POSTGRES_PASSWORD=${var.postgres_password}"]
memory = 512
restart = "unless-stopped"
destroy_grace_seconds = 10
must_run = true
}