From 14c0fd89ebb2ecd3a1e07bd4eac5dfcf9490cf5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Lo=CC=88sken?= Date: Fri, 5 Jun 2020 22:53:40 +0200 Subject: [PATCH 1/6] Extracting version out of tag --- Makefile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index bbb5267..a4baf94 100644 --- a/Makefile +++ b/Makefile @@ -11,6 +11,9 @@ IMAGE="invoiceninja" # Check if v5 tag is passed, so that a v5 version should be built IS_V5=$(shell echo ${TAG} | egrep ^5) +# Version of Invoice Ninja. As the tag can be something like 5.0.4-p1, the version is 5.0.4. +# This supports changes to the Dockerfiles with always the same Invoice Ninja version +VERSION=$(shell echo ${TAG} | sed "s/-.*//") # Building docker images based on alpine. # Assigned tags: @@ -19,10 +22,10 @@ IS_V5=$(shell echo ${TAG} | egrep ^5) .PHONY: build-alpine build-alpine: ifeq ($(IS_V5),) - $(info Make: Building "$(TAG)" tagged images from alpine.) - @docker build -t ${HUB_NAMESPACE}/${IMAGE}:alpine-${TAG} --build-arg INVOICENINJA_VERSION=${TAG} --file ./alpine/Dockerfile . + $(info Make: Building "$(VERSION)" tagged images from alpine.) + @docker build -t ${HUB_NAMESPACE}/${IMAGE}:alpine-${VERSION} --build-arg INVOICENINJA_VERSION=${VERSION} --file ./alpine/Dockerfile . # Tag as alpine-4 - @docker tag ${HUB_NAMESPACE}/${IMAGE}:alpine-${TAG} ${HUB_NAMESPACE}/${IMAGE}:alpine-4 + @docker tag ${HUB_NAMESPACE}/${IMAGE}:alpine-${VERSION} ${HUB_NAMESPACE}/${IMAGE}:alpine-4 $(info Make: Done.) endif @@ -30,7 +33,7 @@ endif push-alpine: ifeq ($(IS_V5),) $(info Make: Pushing tagged images from alpine.) - @docker push ${HUB_NAMESPACE}/${IMAGE}:alpine-${TAG} + @docker push ${HUB_NAMESPACE}/${IMAGE}:alpine-${VERSION} @docker push ${HUB_NAMESPACE}/${IMAGE}:alpine-4 $(info Make: Done.) endif @@ -38,10 +41,10 @@ endif .PHONY: build-alpine-v5 build-alpine-v5: ifneq ($(IS_V5),) - $(info Make: Building "$(TAG)" tagged images from alpine.) - @docker build -t ${HUB_NAMESPACE}/${IMAGE}:${TAG} --build-arg INVOICENINJA_VERSION=${TAG} --file ./alpine/Dockerfile_v5 . - @docker tag ${HUB_NAMESPACE}/${IMAGE}:${TAG} ${HUB_NAMESPACE}/${IMAGE}:5 - @docker tag ${HUB_NAMESPACE}/${IMAGE}:${TAG} ${HUB_NAMESPACE}/${IMAGE}:latest + $(info Make: Building "$(VERSION)" tagged images from alpine.) + @docker build -t ${HUB_NAMESPACE}/${IMAGE}:${VERSION} --build-arg INVOICENINJA_VERSION=${VERSION} --file ./alpine/Dockerfile_v5 . + @docker tag ${HUB_NAMESPACE}/${IMAGE}:${VERSION} ${HUB_NAMESPACE}/${IMAGE}:5 + @docker tag ${HUB_NAMESPACE}/${IMAGE}:${VERSION} ${HUB_NAMESPACE}/${IMAGE}:latest $(info Make: Done.) endif @@ -49,7 +52,7 @@ endif push-alpine-v5: ifneq ($(IS_V5),) $(info Make: Pushing tagged images from alpine.) - @docker push ${HUB_NAMESPACE}/${IMAGE}:${TAG} + @docker push ${HUB_NAMESPACE}/${IMAGE}:${VERSION} @docker push ${HUB_NAMESPACE}/${IMAGE}:5 @docker push ${HUB_NAMESPACE}/${IMAGE}:latest endif From 85161446e999cf322952c0c4b5d0854d791cd87d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Lo=CC=88sken?= Date: Mon, 8 Jun 2020 14:53:16 +0200 Subject: [PATCH 2/6] Fix wrong evaluation of env vars --- entrypoint.sh | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 2b62f94..16e9dd0 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -12,16 +12,9 @@ in_error() { exit 1 } -# Indirect expansion (ie) is not supported in bourne shell. That's why we are using this clunkiness here. +# Indirect expansion (ie) is not supported in bourne shell. That's why we are using this "magic" here. ie_gv() { - local line name value - set | \ - while read line; do - name=${line%=*} value=${line#*=\'} - if [ "$name" = "$1" ]; then - echo ${value%\'} - fi - done + eval "echo \$$1" } # usage: file_env VAR [DEFAULT] @@ -37,7 +30,7 @@ file_env() { in_error "Both $var and $fileVar are set (but are exclusive)" fi - local val="$def" + local val="$def" if [ "$(ie_gv ${var})" != "" ]; then val=$(ie_gv ${var}) elif [ "$(ie_gv ${fileVar})" != "" ]; then From 001c922e453af7a48d9c159c9ff2afddc90a5231 Mon Sep 17 00:00:00 2001 From: Koen Torfs Date: Sun, 14 Jun 2020 18:25:30 +0200 Subject: [PATCH 3/6] Fixes #164 - caddy templating conflicts with php output --- config/caddy/Caddyfile | 1 - 1 file changed, 1 deletion(-) diff --git a/config/caddy/Caddyfile b/config/caddy/Caddyfile index 6ce150f..6ded1e4 100644 --- a/config/caddy/Caddyfile +++ b/config/caddy/Caddyfile @@ -2,6 +2,5 @@ root * /var/www/app/public php_fastcgi app:9000 encode zstd gzip - templates file_server browse } From a7668325e847174add6d514a7d5d0c23862a52ba Mon Sep 17 00:00:00 2001 From: PatSki123 Date: Mon, 6 Jul 2020 08:02:47 -0400 Subject: [PATCH 4/6] Small Typo Added missed word "key" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a382aba..66b58fd 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you feel your question is directly related to a code change or you want to se Before starting Invoice Ninja via Docker make sure you generate a valid application key. If you are not sure what an application key is, please visit [this blog post](https://tighten.co/blog/app-key-and-you/). -To generate an application just run +To generate an application kay just run ```shell docker run --rm -it invoiceninja/invoiceninja php artisan key:generate --show From 2d934fd70309412440e4876b2926ef87f374e65a Mon Sep 17 00:00:00 2001 From: PatSki123 Date: Mon, 6 Jul 2020 10:03:38 -0400 Subject: [PATCH 5/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 66b58fd..9fc420c 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ If you feel your question is directly related to a code change or you want to se Before starting Invoice Ninja via Docker make sure you generate a valid application key. If you are not sure what an application key is, please visit [this blog post](https://tighten.co/blog/app-key-and-you/). -To generate an application kay just run +To generate an application key just run ```shell docker run --rm -it invoiceninja/invoiceninja php artisan key:generate --show From e7f6ef4c35b0d5d7d022d6b12501830e03ed0936 Mon Sep 17 00:00:00 2001 From: Lars Hampe Date: Thu, 30 Jul 2020 10:07:50 +0200 Subject: [PATCH 6/6] add missing npm/nodejs --- alpine/Dockerfile_v5 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/alpine/Dockerfile_v5 b/alpine/Dockerfile_v5 index dea6d6e..f44bc39 100644 --- a/alpine/Dockerfile_v5 +++ b/alpine/Dockerfile_v5 @@ -43,6 +43,8 @@ RUN chmod +x /usr/local/bin/docker-entrypoint RUN set -eux; \ apk add --no-cache \ + nodejs \ + npm \ freetype-dev \ gmp-dev \ libjpeg-turbo-dev \ @@ -92,4 +94,4 @@ ENV APP_ENV production ENV LOG errorlog ENTRYPOINT ["docker-entrypoint"] -CMD ["php-fpm"] \ No newline at end of file +CMD ["php-fpm"]