diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3f74f30 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +node_modules +ocfl-repository \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c3ba0be --- /dev/null +++ b/Dockerfile @@ -0,0 +1,9 @@ +FROM node:12-stretch AS builder +ADD ./ui /srv +RUN cd /srv && rm -rf ./node_modules && npm run build:production + +FROM nginx:latest +COPY --from=builder /srv/dist/* /usr/share/nginx/html/ +COPY configuration/generic-configuration.json /usr/share/nginx/html +COPY nginx/default.conf /etc/nginx/conf.d/default.conf +COPY nginx/mime.types /etc/nginx/mime.types \ No newline at end of file diff --git a/configuration/generic-configuration.json b/configuration/generic-configuration.json new file mode 100644 index 0000000..c480504 --- /dev/null +++ b/configuration/generic-configuration.json @@ -0,0 +1,20 @@ +{ + "service": { + "search": "/search", + "api": null + }, + "imageFormats": ["image/jpg", "image/jpeg"], + "audioFormats": ["audio/mpeg"], + "videoFormats": ["video/quicktime", "video/mp4"], + "documentFileExtensions": [ + "pdf", + "doc", + "docx", + "xls", + "xlsx", + "ppt", + "pptx" + ], + "transcriptionFileExtensions": ["eaf", "trs", "ixt", "flextext"], + "indexerMetadataNamespace": "ocfl-indexer:meta" +} diff --git a/nginx/configuration.json b/configuration/paradisec-configuration.json similarity index 100% rename from nginx/configuration.json rename to configuration/paradisec-configuration.json diff --git a/publish-new-release b/publish-new-release new file mode 100755 index 0000000..5d45c1b --- /dev/null +++ b/publish-new-release @@ -0,0 +1,45 @@ +#!/bin/bash + +TAG="coedl/ocfl-viewer" + +# list current tags in repo +echo -e "Current Tags: \n\n" +git tag -l + +# get the new version tag +echo "" +read -p 'Please provide a tag for this release (major.minor.patch): ' VERSION +echo "" + +read -p "Are you sure you wish to tag this release '${VERSION}'? type: 'yes': " resp +echo "" +if [ "$resp" != "yes" ] ; then + echo "Ok. Stopping now." + exit 0 +fi + +# tag the repo with the new version +echo -e "Ok - Building the new container\n\n" +git tag "v${VERSION}" + +# get the tag to be used for the docker images +echo 'What tag should be used for this image? [default: coedl/ocfl-viewer]' +read -p 'Tag: (enter to use the default)' resp +if [ ! -z ${resp} ] ; then + TAG="$resp" +fi + +echo -e "\nSetting tag to: ${TAG}\n" + +# build the container tagging with the specified tag and version +docker build -t ${TAG}:${VERSION} . +docker image tag ${TAG}:${VERSION} ${TAG}:latest + +# push the new container +echo -e "\nLog in to docker hub to push the container." +docker login +docker push ${TAG}:${VERSION} +docker push ${TAG}:latest + +# push the git tags +git push origin --tags \ No newline at end of file