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

@ -1,49 +1,62 @@
{
"$schema": "../schema.json",
"name": "Bitcoin",
"available": true,
"exposable": false,
"no_gui": true,
"port": 8333,
"id": "bitcoind",
"description": "Bitcoin core node",
"tipi_version": 1,
"version": "26.0",
"categories": ["finance"],
"short_desc": "Bitcoin core node",
"author": "Bitcoin developers",
"source": "https://github.com/lncm/docker-bitcoind",
"form_fields": [
{
"type": "number",
"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.",
"required": false,
"env_variable": "DB_CACHE"
},
{
"type": "number",
"label": "Max Mempool Size (In mb)",
"hint": "Keep the transaction memory pool below <n> megabytes. Default 300 Mb.",
"required": false,
"env_variable": "MAX_MEMPOOL"
},
{
"type": "number",
"label": "Listen for Incoming Connections (0 disabled / 1 enabled)",
"hint": "Accept incoming connections from peers. Default disabled.",
"regex": "^[01]$",
"required": false,
"env_variable": "LISTEN"
},
{
"type": "number",
"label": "Max Peer Connections",
"hint": "Maintain at most N connections to peers. Default 125.",
"required": false,
"env_variable": "MAXPEERS"
}
],
"supported_architectures": ["amd64", "arm64", "arm"]
}
"$schema": "../schema.json",
"name": "Bitcoin",
"available": true,
"exposable": false,
"no_gui": true,
"port": 8333,
"id": "bitcoind",
"description": "Bitcoin core node",
"tipi_version": 1,
"version": "26.0",
"categories": [
"finance"
],
"short_desc": "Bitcoin core node",
"author": "Bitcoin developers",
"source": "https://github.com/lncm/docker-bitcoind",
"form_fields": [
{
"type": "number",
"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.",
"required": false,
"env_variable": "BITCOIND_DB_CACHE"
},
{
"type": "number",
"label": "Max Mempool Size (In mb)",
"hint": "Keep the transaction memory pool below <n> megabytes. Default 300 Mb.",
"required": false,
"env_variable": "BITCOIND_MAX_MEMPOOL"
},
{
"type": "text",
"label": "Listen for Incoming Connections",
"hint": "Accept incoming connections from peers.",
"required": false,
"env_variable": "BITCOIND_LISTEN",
"options": [
{
"label": "Yes",
"value": "1"
},
{
"label": "No",
"value": "0"
}
]
},
{
"type": "number",
"label": "Max Peer Connections",
"hint": "Maintain at most N connections to peers. Leave empty for default 125.",
"required": false,
"env_variable": "BITCOIND_MAXPEERS"
}
],
"supported_architectures": [
"amd64",
"arm64"
]
}

View File

@ -14,9 +14,34 @@ services:
restart: unless-stopped
stop_grace_period: 15m30s
command: >-
--dbcache=${DB_CACHE:-450}
--maxmempool=${MAX_MEMPOOL:-300}
--listen=${LISTEN:-0}
--maxconnections=${MAXPEERS:-125}
--dbcache=${BITCOIND_DB_CACHE:-450}
--maxmempool=${BITCOIND_MAX_MEMPOOL:-300}
--listen=${BITCOIND_LISTEN:-0}
--maxconnections=${BITCOIND_MAXPEERS:-125}
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