Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
*.md
LICENSE
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM --platform=linux/amd64 node:19-alpine3.16

RUN apk add \
bash \
ca-certificates

RUN mkdir -p /usr/local/share/ca-certificates \
&& chmod 333 /usr/local/share/ca-certificates
# && chmod 333 /etc/ssl/certs # this doesn't work

# RUN addgroup -g 2001 -S lnurl && adduser -u 1001 -S lnurl -G lnurl

WORKDIR /usr/src/app

COPY package*.json ./
RUN npm ci --omit=dev
# install dependencies
RUN npm install knex pg

COPY . .
RUN chmod +x ./entrypoint.sh
# && chown lnurl:lnurl -R /usr/src/app

EXPOSE 3000
# USER lnurl
CMD ["./entrypoint.sh"]
13 changes: 13 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# add self-signed lnd cert to system

cp $LND_CERT_PATH /usr/local/share/ca-certificates/lnd.crt
update-ca-certificates

node cli.js server --host "$LNURL_HOST" \
--port "$LNURL_PORT" \
--lightning.backend "lnd" \
--lightning.config "{\"hostname\": \"$LND_HOST:$LND_PORT\", \"macaroon\": \"$LND_MACAROON_PATH\", \"cert\": \"$LND_CERT_PATH\"}" \
--store.backend "knex" \
--store.config "{\"client\":\"postgres\",\"connection\":{\"host\":\"$POSTGRES_HOST\",\"user\":\"$POSTGRES_USER\",\"password\":\"$POSTGRES_PASSWORD\",\"database\":\"$POSTGRES_DB\"}}"