diff --git a/.github/release-please/config.json b/.github/release-please/config.json index ec3cead..76fc947 100644 --- a/.github/release-please/config.json +++ b/.github/release-please/config.json @@ -29,6 +29,12 @@ }, "images/spilo": { "package-name": "spilo" + }, + "images/masterportal/masterportal-v2": { + "package-name": "masterportal" + }, + "images/masterportal/masterportal-v3": { + "package-name": "masterportal" } } } \ No newline at end of file diff --git a/.github/release-please/manifest.json b/.github/release-please/manifest.json index e0cd4e0..ee38cd8 100644 --- a/.github/release-please/manifest.json +++ b/.github/release-please/manifest.json @@ -1 +1 @@ -{"images/ckan":"1.0.3","images/ckan-dcatapde":"1.0.3","images/solr-ckan":"1.0.8","images/spilo":"16.0.0"} +{"images/ckan":"1.0.3","images/ckan-dcatapde":"1.0.3","images/solr-ckan":"1.0.8","images/spilo":"16.0.0","images/masterportal/masterportal-v2":"2.48.0","images/masterportal/masterportal-v3":"3.1.0"} diff --git a/.github/release-please/platform.json b/.github/release-please/platform.json index 4b9da6a..5983929 100644 --- a/.github/release-please/platform.json +++ b/.github/release-please/platform.json @@ -1 +1 @@ -{"images/ckan":"linux/amd64","images/ckan-dcatapde":"linux/amd64","images/solr-ckan":"linux/amd64,linux/arm64","images/spilo":"linux/amd64"} \ No newline at end of file +{"images/ckan":"linux/amd64","images/ckan-dcatapde":"linux/amd64","images/solr-ckan":"linux/amd64,linux/arm64","images/spilo":"linux/amd64","images/masterportal/masterportal-v2":"linux/amd64,linux/arm64","images/masterportal/masterportal-v3":"linux/amd64,linux/arm64"} \ No newline at end of file diff --git a/images/masterportal/masterportal-v2/Dockerfile b/images/masterportal/masterportal-v2/Dockerfile new file mode 100644 index 0000000..822c120 --- /dev/null +++ b/images/masterportal/masterportal-v2/Dockerfile @@ -0,0 +1,25 @@ +FROM nginx:1.27.1-alpine + +ENV MASTERPORTAL_VERSION 2.48.0 + +# download and restructure Masterportal +RUN curl -fsLw "status %{http_code}, size: %{size_download}" \ + -o /tmp/masterportal.zip \ + https://bitbucket.org/geowerkstatt-hamburg/masterportal/downloads/examples-$MASTERPORTAL_VERSION.zip \ + && unzip -d /tmp/masterportal /tmp/masterportal.zip \ + && rm -v /tmp/masterportal.zip \ + && mv /tmp/masterportal/Basic /usr/share/nginx/html/upstream \ + && mv /tmp/masterportal/mastercode/* /usr/share/nginx/html/upstream/mastercode \ + && rmdir /tmp/masterportal/mastercode /tmp/masterportal \ + && sed -i 's#\.\./mastercode/[^/]*/#./mastercode/#g' /usr/share/nginx/html/upstream/index.html + +# layer git-sync volume over upstream +# rewrite the hard-coded version number in some paths to reduce the necessary changes to overlays for updates +# direct the client to let the server confirm that the cached files are still up to date every time, this should solve the stale cache problems that are exacerbated by the rewrite rule but existed anyway +# this configuration is done as a modification instead of a copied file to pick up new default settings after updates +RUN sed -i 's#location / {#\0 add_header Cache-Control no-cache; rewrite ^/$ /index.html; rewrite ^/mastercode/'`printf %s "$MASTERPORTAL_VERSION" | sed 's/\./_/g'`'/(.*)$ /mastercode/$1; try_files /synced/current/$uri /upstream/$uri =404;#' /etc/nginx/conf.d/default.conf + +# use tmp files and other port to allow running as non-root user as per https://hub.docker.com/_/nginx +RUN sed -i 's#pid .*#pid /tmp/nginx.pid;#' /etc/nginx/nginx.conf \ + && for i in client_body proxy fastcgi uwsgi scgi; do sed -i "s#http {#\\0 ${i}_temp_path /tmp/${i}_temp;#" /etc/nginx/nginx.conf || exit 1; done \ + && sed -i 's#listen \+80#listen 8080#' /etc/nginx/conf.d/default.conf diff --git a/images/masterportal/masterportal-v3/Dockerfile b/images/masterportal/masterportal-v3/Dockerfile new file mode 100644 index 0000000..3d207b2 --- /dev/null +++ b/images/masterportal/masterportal-v3/Dockerfile @@ -0,0 +1,25 @@ +FROM nginx:1.27.1-alpine + +ENV MASTERPORTAL_VERSION 3.1.0 + +# download and restructure Masterportal +RUN curl -fsLw "status %{http_code}, size: %{size_download}" \ + -o /tmp/masterportal.zip \ + https://bitbucket.org/geowerkstatt-hamburg/masterportal/downloads/examples-$MASTERPORTAL_VERSION.zip \ + && unzip -d /tmp/masterportal /tmp/masterportal.zip \ + && rm -v /tmp/masterportal.zip \ + && mv /tmp/masterportal/Basic /usr/share/nginx/html/upstream \ + && mv /tmp/masterportal/mastercode/* /usr/share/nginx/html/upstream/mastercode \ + && rmdir /tmp/masterportal/mastercode /tmp/masterportal \ + && sed -i 's#\.\./mastercode/[^/]*/#./mastercode/#g' /usr/share/nginx/html/upstream/index.html + +# layer git-sync volume over upstream +# rewrite the hard-coded version number in some paths to reduce the necessary changes to overlays for updates +# direct the client to let the server confirm that the cached files are still up to date every time, this should solve the stale cache problems that are exacerbated by the rewrite rule but existed anyway +# this configuration is done as a modification instead of a copied file to pick up new default settings after updates +RUN sed -i 's#location / {#\0 add_header Cache-Control no-cache; rewrite ^/$ /index.html; rewrite ^/mastercode/'`printf %s "$MASTERPORTAL_VERSION" | sed 's/\./_/g'`'/(.*)$ /mastercode/$1; try_files /synced/current/$uri /upstream/$uri =404;#' /etc/nginx/conf.d/default.conf + +# use tmp files and other port to allow running as non-root user as per https://hub.docker.com/_/nginx +RUN sed -i 's#pid .*#pid /tmp/nginx.pid;#' /etc/nginx/nginx.conf \ + && for i in client_body proxy fastcgi uwsgi scgi; do sed -i "s#http {#\\0 ${i}_temp_path /tmp/${i}_temp;#" /etc/nginx/nginx.conf || exit 1; done \ + && sed -i 's#listen \+80#listen 8080#' /etc/nginx/conf.d/default.conf