From a6940cb3c8fce3dd60c4539e1075e769677e8bf2 Mon Sep 17 00:00:00 2001 From: Aaron Dewes Date: Wed, 16 Dec 2020 21:49:27 +0100 Subject: [PATCH] Comments --- Dockerfile | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f4f1414..5f895f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,27 @@ FROM node:buster-slim AS builder +# These packages are required for building LNDHub RUN apt-get update && apt-get -y install git python3 -# Switch to official images once my PR is merged + +# TODO: Switch to official images once my PR is merged RUN git clone https://github.com/AaronDewes/LndHub.git -b update-dependencies /lndhub WORKDIR /lndhub RUN npm i -# Delete git data as it's not needed inside the container - -RUN rm -rf .git - FROM node:buster-slim +# Create a specific user so LNDHub doesn't run as root RUN adduser --disabled-password --uid 1000 --home /lndhub --gecos "" lndhub + +# Copy LNDHub with installed modules from builder COPY --from=builder /lndhub /lndhub +# Delete git data as it's not needed inside the container +RUN rm -rf .git + +# Create logs folder and ensure permissions are set correctly RUN mkdir /lndhub/logs && chown -R lndhun:lndhub /lndhub USER lndhub