Add lnbits-v1 to sndev (#2184)

* Add lnbits-v1

* use v1 in dev when specified

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
This commit is contained in:
Bryan Mutai 2025-06-06 03:04:22 +03:00 committed by GitHub
parent d13ba034fe
commit 1888b19792
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 38 additions and 1 deletions

View File

@ -184,6 +184,7 @@ grpc_proxy=http://tor:7050/
# lnbits # lnbits
LNBITS_WEB_PORT=5001 LNBITS_WEB_PORT=5001
LNBITS_WEB_PORT_V1=5002
# CPU shares for each category # CPU shares for each category
CPU_SHARES_IMPORTANT=1024 CPU_SHARES_IMPORTANT=1024

View File

@ -809,6 +809,36 @@ services:
CONNECT: "localhost:${LNBITS_WEB_PORT}" CONNECT: "localhost:${LNBITS_WEB_PORT}"
TORDIR: "/app/.tor" TORDIR: "/app/.tor"
cpu_shares: "${CPU_SHARES_LOW}" cpu_shares: "${CPU_SHARES_LOW}"
lnbits-v1:
build:
context: ./docker/lnbits-v1
container_name: lnbits-v1
profiles:
- wallets
restart: unless-stopped
ports:
- "${LNBITS_WEB_PORT_V1}:5000"
depends_on:
tor:
condition: service_healthy
restart: true
lnd:
condition: service_healthy
restart: true
environment:
- LNBITS_ADMIN_UI=true
- LNBITS_BACKEND_WALLET_CLASS=LndWallet
- LND_GRPC_ENDPOINT=lnd
- LND_GRPC_PORT=10009
- LND_GRPC_CERT=/app/.lnd/tls.cert
- LND_GRPC_MACAROON=/app/.lnd/data/chain/bitcoin/regtest/admin.macaroon
volumes:
- lnd:/app/.lnd
- tordata:/app/.tor
labels:
CONNECT: "localhost:${LNBITS_WEB_PORT_V1}"
TORDIR: "/app/.tor"
cpu_shares: "${CPU_SHARES_LOW}"
dnsmasq: dnsmasq:
image: 4km3/dnsmasq:2.90-r3 image: 4km3/dnsmasq:2.90-r3
profiles: profiles:

View File

@ -0,0 +1,5 @@
FROM lnbits/lnbits:latest
COPY ["./data/database.sqlite3", "/app/data/database.sqlite3"]
COPY ["./data/.super_user", "/app/data/.super_user"]

View File

@ -0,0 +1 @@
e46288268b67457399a5fca81809573e

Binary file not shown.

View File

@ -38,7 +38,7 @@ export async function createInvoice (
if (process.env.NODE_ENV !== 'production' && hostname.startsWith('localhost:')) { if (process.env.NODE_ENV !== 'production' && hostname.startsWith('localhost:')) {
// to make it possible to attach LNbits for receives during local dev // to make it possible to attach LNbits for receives during local dev
hostname = 'lnbits:5000' hostname = hostname === `localhost:${process.env.LNBITS_WEB_PORT}` ? 'lnbits:5000' : 'lnbits-v1:5000'
} }
let res let res