add LNbits Dockerfiles (#77)

* add LNbits Dockerfiles

* remove sh from CMD in Dockerfile for faster restarts with init:true
This commit is contained in:
Markus Petzsch 2024-01-18 10:14:48 +01:00 committed by GitHub
parent d25a0ecd08
commit d9089aa7ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,34 @@
FROM python:3.10-slim-bullseye
ENV REPO https://github.com/lnbits/lnbits
ENV REPO_REF 0.11.3
RUN apt-get clean
RUN apt-get update
RUN apt-get install -y curl pkg-config build-essential git
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
# needed for backups postgresql-client version 14 (pg_dump)
RUN apt-get install -y apt-utils wget
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get install -y postgresql-client-14
WORKDIR /app
RUN git clone "$REPO" . --depth=1 --branch "$REPO_REF" && git checkout "$REPO_REF"
RUN mkdir data
RUN poetry install --only main
# hardcoded so we can ommit the sh in CMD that was used in upstream lnbits Dockerfile
#ENV LNBITS_PORT="5000"
#ENV LNBITS_HOST="0.0.0.0"
EXPOSE 5000
CMD ["poetry", "run", "lnbits", "--port", "5000", "--host", "0.0.0.0"]

View File

@ -0,0 +1,34 @@
FROM python:3.10-slim-bullseye
ENV REPO https://github.com/lnbits/lnbits
ENV REPO_REF 0.11.3
RUN apt-get clean
RUN apt-get update
RUN apt-get install -y curl pkg-config build-essential git
RUN curl -sSL https://install.python-poetry.org | python3 -
ENV PATH="/root/.local/bin:$PATH"
# needed for backups postgresql-client version 14 (pg_dump)
RUN apt-get install -y apt-utils wget
RUN echo "deb http://apt.postgresql.org/pub/repos/apt bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
RUN apt-get update
RUN apt-get install -y postgresql-client-14
WORKDIR /app
RUN git clone "$REPO" . --depth=1 --branch "$REPO_REF" && git checkout "$REPO_REF"
RUN mkdir data
RUN poetry install --only main
# hardcoded so we can ommit the sh in CMD that was used in upstream lnbits Dockerfile
#ENV LNBITS_PORT="5000"
#ENV LNBITS_HOST="0.0.0.0"
EXPOSE 5000
CMD ["poetry", "run", "lnbits", "--port", "5000", "--host", "0.0.0.0"]