btcpayserver-docker/docker-compose-generator/docker-fragments/opt-add-bluewallet-lndhub.yml
Dennis Reimann dfce1f56e2
LNDhub: Overrides for entrypoint and command to fix file permissions
The copied cert and macaroon belong to the root user and the LNDhub app is run as user lndhub. We need to override the entrypoint and command to change the ownership of those files and then start the app.

Fixes #701.
2022-08-29 15:35:16 +02:00

41 lines
1.6 KiB
YAML

version: "3"
services:
bluewallet_lndhub_redis:
container_name: bluewallet_lndhub_redis
image: "redis:6.2.2-buster@sha256:e10f55f92478715698a2cef97c2bbdc48df2a05081edd884938903aa60df6396"
command: "redis-server --requirepass S7bk49NBp29khUci4Zw28vsBviCnYfZ2QLTEsQNizq9ni5ur"
restart: "on-failure"
stop_grace_period: "1m"
volumes:
- "bluewallet_lndhub_redisdir:/data"
bluewallet_lndhub_app:
container_name: bluewallet_lndhub_app
image: "bluewalletorganization/lndhub:v1.4.1"
user: "0:0"
depends_on: [ "bluewallet_lndhub_redis" ]
restart: "on-failure"
stop_grace_period: "1m"
volumes:
- "lnd_bitcoin_datadir:/lnd:ro"
environment:
PORT: "3000"
LND_CERT_FILE: "/lnd/tls.cert"
LND_ADMIN_MACAROON_FILE: "/lnd/admin.macaroon"
CONFIG: '{ "rateLimit": 10000, "postRateLimit": 10000, "redis": { "port": 6379, "host": "bluewallet_lndhub_redis", "family": 4, "password": "S7bk49NBp29khUci4Zw28vsBviCnYfZ2QLTEsQNizq9ni5ur", "db": 0 }, "lnd": { "url": "lnd_bitcoin:10009", "password": ""}}'
# overrides to fix file permissions, see original: https://github.com/BlueWallet/LndHub/blob/master/Dockerfile
entrypoint: "bash"
command: -c "cp /lnd/tls.cert /lnd/admin.macaroon /lndhub/ && cd /lndhub && chown lndhub:lndhub admin.macaroon tls.cert && npm start"
btcpayserver:
environment:
BTCPAY_EXTERNALSERVICES: "Blue Wallet LNDHub:${BTCPAY_PROTOCOL:-https}://${BTCPAY_HOST}/bluewallet_lndhub_app;"
# use docker native volumes
volumes:
bluewallet_lndhub_redisdir:
required:
- "bitcoin-lnd"