Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(masterportal): add masterportal to oci repo #72

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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