File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ *
2+ ! build /
3+ ! class /
4+ ! controllers /
5+ ! scripts /
6+ ! static /
7+ ! templates /
8+ ! utils /
9+ ! * .js
10+ ! .babelrc
11+ ! .eslint *
12+ ! admin.macaroon
13+ ! package * .json
14+ ! rpc.proto
15+ ! tls.cert
Original file line number Diff line number Diff line change 22
33admin.macaroon
44tls.cert
5+ build /
56logs /
67
78# dependencies
Original file line number Diff line number Diff line change @@ -13,19 +13,17 @@ RUN apt-get update && apt-get -y install python3
1313
1414WORKDIR /lndhub
1515
16- # Copy 'package-lock.json' and 'package.json'
17- COPY package.json package-lock.json ./
16+ # Copy project files and folders to the current working directory
17+ COPY . .
1818
1919# Install dependencies
2020RUN npm i
21-
22- # Copy project files and folders to the current working directory
23- COPY . .
21+ RUN npm run build
2422
2523# Delete git data as it's not needed inside the container
2624RUN rm -rf .git
2725
28- FROM node:16-bullseye-slim
26+ FROM node:16-alpine
2927
3028# Create a specific user so LNDHub doesn't run as root
3129COPY --from=perms /etc/group /etc/passwd /etc/shadow /etc/
@@ -34,10 +32,11 @@ COPY --from=perms /etc/group /etc/passwd /etc/shadow /etc/
3432COPY --from=builder /lndhub /lndhub
3533
3634# Create logs folder and ensure permissions are set correctly
37- RUN mkdir /lndhub/logs && chown -R lndhub:lndhub /lndhub
35+ RUN mkdir -p /lndhub/logs && chown -R lndhub:lndhub /lndhub
3836USER lndhub
3937
4038ENV PORT=3000
4139EXPOSE 3000
40+ WORKDIR /lndhub
4241
4342CMD cp $LND_CERT_FILE /lndhub/ && cp $LND_ADMIN_MACAROON_FILE /lndhub/ && cd /lndhub && npm start
Original file line number Diff line number Diff line change @@ -5,7 +5,9 @@ let express = require('express');
55let router = express . Router ( ) ;
66let logger = require ( '../utils/logger' ) ;
77const MIN_BTC_BLOCK = 670000 ;
8- console . log ( 'using config' , JSON . stringify ( config ) ) ;
8+ if ( process . env . NODE_ENV !== 'prod' ) {
9+ console . log ( 'using config' , JSON . stringify ( config ) ) ;
10+ }
911
1012var Redis = require ( 'ioredis' ) ;
1113var redis = new Redis ( config . redis ) ;
Original file line number Diff line number Diff line change 55 "main" : " index.js" ,
66 "scripts" : {
77 "test" : " echo \" Error: no test specified\" && exit 1" ,
8+ "build" : " ./node_modules/.bin/babel ./ --ignore node_modules/ --ignore *.spec.js --out-dir ./build" ,
89 "dev" : " nodemon node_modules/.bin/babel-node index.js" ,
910 "start" : " node_modules/.bin/babel-node index.js" ,
1011 "lint" : " ./node_modules/.bin/eslint ./ controllers/ class/ --fix"
You can’t perform that action at this time.
0 commit comments