chore(bitcoin): add traefik labels and simplify config

This commit is contained in:
Nicolas Meienberger 2024-03-18 22:18:17 +01:00
parent 7c039b97bb
commit 944aa771bb
2 changed files with 91 additions and 53 deletions

View File

@ -9,7 +9,9 @@
"description": "Bitcoin core node", "description": "Bitcoin core node",
"tipi_version": 1, "tipi_version": 1,
"version": "26.0", "version": "26.0",
"categories": ["finance"], "categories": [
"finance"
],
"short_desc": "Bitcoin core node", "short_desc": "Bitcoin core node",
"author": "Bitcoin developers", "author": "Bitcoin developers",
"source": "https://github.com/lncm/docker-bitcoind", "source": "https://github.com/lncm/docker-bitcoind",
@ -19,31 +21,42 @@
"label": "DB Cache Size (In mb)", "label": "DB Cache Size (In mb)",
"hint": "Set database cache size in megabytes; machines sync faster with a larger cache. Recommend setting as high as possible based upon machine's available RAM. Default 450 Mb.", "hint": "Set database cache size in megabytes; machines sync faster with a larger cache. Recommend setting as high as possible based upon machine's available RAM. Default 450 Mb.",
"required": false, "required": false,
"env_variable": "DB_CACHE" "env_variable": "BITCOIND_DB_CACHE"
}, },
{ {
"type": "number", "type": "number",
"label": "Max Mempool Size (In mb)", "label": "Max Mempool Size (In mb)",
"hint": "Keep the transaction memory pool below <n> megabytes. Default 300 Mb.", "hint": "Keep the transaction memory pool below <n> megabytes. Default 300 Mb.",
"required": false, "required": false,
"env_variable": "MAX_MEMPOOL" "env_variable": "BITCOIND_MAX_MEMPOOL"
}, },
{ {
"type": "number", "type": "text",
"label": "Listen for Incoming Connections (0 disabled / 1 enabled)", "label": "Listen for Incoming Connections",
"hint": "Accept incoming connections from peers. Default disabled.", "hint": "Accept incoming connections from peers.",
"regex": "^[01]$",
"required": false, "required": false,
"env_variable": "LISTEN" "env_variable": "BITCOIND_LISTEN",
"options": [
{
"label": "Yes",
"value": "1"
},
{
"label": "No",
"value": "0"
}
]
}, },
{ {
"type": "number", "type": "number",
"label": "Max Peer Connections", "label": "Max Peer Connections",
"hint": "Maintain at most N connections to peers. Default 125.", "hint": "Maintain at most N connections to peers. Leave empty for default 125.",
"required": false, "required": false,
"env_variable": "MAXPEERS" "env_variable": "BITCOIND_MAXPEERS"
} }
], ],
"supported_architectures": ["amd64", "arm64", "arm"] "supported_architectures": [
"amd64",
"arm64"
]
} }

View File

@ -14,9 +14,34 @@ services:
restart: unless-stopped restart: unless-stopped
stop_grace_period: 15m30s stop_grace_period: 15m30s
command: >- command: >-
--dbcache=${DB_CACHE:-450} --dbcache=${BITCOIND_DB_CACHE:-450}
--maxmempool=${MAX_MEMPOOL:-300} --maxmempool=${BITCOIND_MAX_MEMPOOL:-300}
--listen=${LISTEN:-0} --listen=${BITCOIND_LISTEN:-0}
--maxconnections=${MAXPEERS:-125} --maxconnections=${BITCOIND_MAXPEERS:-125}
networks: networks:
- tipi_main_network - tipi_main_network
labels:
# Main
traefik.enable: true
traefik.http.middlewares.bitcoind-web-redirect.redirectscheme.scheme: https
traefik.http.services.bitcoind.loadbalancer.server.port: 3333
# Web
traefik.http.routers.bitcoind-insecure.rule: Host(`${APP_DOMAIN}`)
traefik.http.routers.bitcoind-insecure.entrypoints: web
traefik.http.routers.bitcoind-insecure.service: bitcoind
traefik.http.routers.bitcoind-insecure.middlewares: bitcoind-web-redirect
# Websecure
traefik.http.routers.bitcoind.rule: Host(`${APP_DOMAIN}`)
traefik.http.routers.bitcoind.entrypoints: websecure
traefik.http.routers.bitcoind.service: bitcoind
traefik.http.routers.bitcoind.tls.certresolver: myresolver
# Local domain
traefik.http.routers.bitcoind-local-insecure.rule: Host(`bitcoind.${LOCAL_DOMAIN}`)
traefik.http.routers.bitcoind-local-insecure.entrypoints: web
traefik.http.routers.bitcoind-local-insecure.service: bitcoind
traefik.http.routers.bitcoind-local-insecure.middlewares: bitcoind-web-redirect
# Local domain secure
traefik.http.routers.bitcoind-local.rule: Host(`bitcoind.${LOCAL_DOMAIN}`)
traefik.http.routers.bitcoind-local.entrypoints: websecure
traefik.http.routers.bitcoind-local.service: bitcoind
traefik.http.routers.bitcoind-local.tls: true