-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(masterportal): add masterportal to oci repo
- Loading branch information
Showing
5 changed files
with
58 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"images/ckan":"linux/amd64","images/ckan-dcatapde":"linux/amd64","images/solr-ckan":"linux/amd64,linux/arm64","images/spilo":"linux/amd64"} | ||
{"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"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |