diff --git a/.env-example b/.env-example new file mode 100644 index 00000000..58b74d5a --- /dev/null +++ b/.env-example @@ -0,0 +1 @@ +IMAGE=you/lndg diff --git a/.gitignore b/.gitignore index 9e8eb962..5acb1658 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +.env* +!.env-example __pycache__ db.sqlite3 lndg/settings.py @@ -10,3 +12,11 @@ gui/static/admin gui/static/rest_framework data/ .DS_Store +container +doc +scripts +.github +.git +!scripts/entrypoint.sh +!scripts/init.sh +!scripts/suinit.sh diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 6f6f47d6..00000000 --- a/Dockerfile +++ /dev/null @@ -1,9 +0,0 @@ -FROM python:3-alpine -ENV PYTHONUNBUFFERED 1 - -RUN apk add g++ linux-headers -COPY . /app/ -WORKDIR /app - -RUN pip install -r requirements.txt -RUN pip install supervisor whitenoise diff --git a/justfile b/justfile index e6bf1105..da7ace7b 100644 --- a/justfile +++ b/justfile @@ -1,10 +1,23 @@ -IMAGE := "gitea.k8s.chevdor.cc/chevdor/lndg" - build_image: #!/usr/bin/env bash + IMAGE=${IMAGE:-cryptosharks131/lndg} + + # Hacky but the version does not seem to be extracted elsewhere... + VERSION=$(cat gui/templates/base.html | sed -nE 's/.*LNDg v([0-9]+\.[0-9]+\.[0-9]+).*/\1/p') + echo "Building image $IMAGE:$VERSION" - docker build -t {{IMAGE}} --build-arg SUPERVISOR=0 -f container/Dockerfile . + docker build \ + -t $IMAGE:$VERSION \ + -t $IMAGE:latest \ + --build-arg SUPERVISOR=0 \ + -f container/Dockerfile \ + . docker images | grep lndg push_image: - docker push {{IMAGE}} + #!/usr/bin/env bash + IMAGE=${IMAGE:-cryptosharks131/lndg} + # Hacky but the version does not seem to be extracted elsewhere... + VERSION=$(cat gui/templates/base.html | sed -nE 's/.*LNDg v([0-9]+\.[0-9]+\.[0-9]+).*/\1/p') + docker push $IMAGE:latest + docker push $IMAGE:$VERSION