Skip to content

Commit

Permalink
feat(masterportal): add masterportal to oci repo (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyeKlu committed Aug 29, 2024
1 parent 616d1ec commit 88d1d24
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/release-please/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@
},
"images/spilo": {
"package-name": "spilo"
},
"images/masterportal/masterportal-v2": {
"package-name": "masterportal"
},
"images/masterportal/masterportal-v3": {
"package-name": "masterportal"
}
}
}
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
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"}
2 changes: 1 addition & 1 deletion .github/release-please/platform.json
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"}
25 changes: 25 additions & 0 deletions images/masterportal/masterportal-v2/Dockerfile
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
25 changes: 25 additions & 0 deletions images/masterportal/masterportal-v3/Dockerfile
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

0 comments on commit 88d1d24

Please sign in to comment.