This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
data.tf
53 lines (51 loc) · 1.39 KB
/
data.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
41
42
43
44
45
46
47
48
49
50
51
52
53
data "template_file" "docker_compose_config" {
template = <<-TEMPLATE
# Generated by terraform module. Do not edit manually!
version: '3'
services:
instance:
image: ${var.image}
restart: always
volumes:
- './data:/home/bitcoin/.bitcoin'
ports:
- '8332:8332'
- '8333:8333'
- '18332:18332'
- '18333:18333'
command:
- '-printtoconsole'
- '-rpcallowip=0.0.0.0/0'
- '-rpcbind=0.0.0.0'
- '-onlynet=${var.onlynet}'
%{ if var.txindex ~}
- '-txindex'
%{ endif ~}
%{ if var.testnet ~}
- '-testnet'
%{ endif ~}
- '-rpcuser=${var.rpc_user}'
- '-rpcpassword=${local.rpc_password}'
- '-prune=${var.prune}'
%{ if length(var.extra_args) > 0 ~}
${indent(10, join("\n", formatlist("- '%s'", var.extra_args)))}
%{ endif ~}
%{ if var.bitcoin_exporter ~}
exporter:
image: 4ops/bitcoin-exporter:stable
restart: always
depends_on:
- instance
links:
- 'instance:instance'
ports:
- '9133:9133'
environment:
BITCOIN_RPCUSER: '${var.rpc_user}'
BITCOIN_RPCPASSWORD: '${local.rpc_password}'
BITCOIN_RPCHOST: 'instance'
BITCOIN_RPCPORT: '${var.testnet ? 18332 : 8332}'
LOG_LEVEL: 'info'
%{ endif }
TEMPLATE
}