diff --git a/Dockerfile b/Dockerfile index 675409b..11428c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,23 @@ -from nginx:latest -MAINTAINER USGS LCMAP http://eros.usgs.gov +FROM centos:centos7 -RUN mkdir /usr/share/man/man1 -RUN apt-get update -RUN apt-get install default-jdk curl vim -y +RUN yum update -y +## Install Java +RUN yum install -y java-1.8.0-openjdk.x86_64 java-1.8.0-openjdk-devel.x86_64 java-1.8.0-openjdk-headless.x86_64 + +## Install NGINX +ENV nginxversion="1.16.1-1" \ + os="centos" \ + osversion="7" \ + elversion="7" + +RUN yum install -y wget openssl sed &&\ + yum -y autoremove &&\ + yum clean all &&\ + wget http://nginx.org/packages/$os/$osversion/x86_64/RPMS/nginx-$nginxversion.el$elversion.ngx.x86_64.rpm &&\ + rpm -iv nginx-$nginxversion.el$elversion.ngx.x86_64.rpm + +## Install Mastodon COPY resources/public/index.html /usr/share/nginx/html/index.html COPY resources/public/js/compiled/mastodon_min.js /usr/share/nginx/html/js/compiled/mastodon_min.js COPY resources/public/js/jquery.min.js /usr/share/nginx/html/js/jquery.min.js @@ -17,4 +30,7 @@ COPY project.clj /project.clj COPY target/lcmap-mastodon-*-standalone.jar / RUN mkdir /data + +# Run! CMD /startup.sh + diff --git a/bin/build b/bin/build index fb79a21..9e3d96a 100755 --- a/bin/build +++ b/bin/build @@ -14,7 +14,7 @@ BRANCH="${TRAVIS_BRANCH:-`git rev-parse --abbrev-ref HEAD | tr / -`}" echo Branch: $BRANCH # ...same for the commit. -COMMIT="${TRAVIS_COMMIT:-`git rev-parse HEAD`}" +COMMIT=`git rev-parse --short HEAD` echo Commit: $COMMIT # Version is extracted from project.clj so that a meaningful tag can @@ -32,22 +32,20 @@ else exit 1 fi +# Including the short commit SHA ensures uniquely identified builds +# as its possible for users to commit changes without incrementing +# version numbers, resulting new builds with the same tag +BRANCH_TAG=$REPO:$BRANCH-$VERSION-$COMMIT +echo "BRANCH_TAG: ${BRANCH_TAG}" + # Travis will build topic branches, but Docker images should not be # built for each one because this would result in a *lot* of images # during periods of active development. if [ "$BRANCH" == "master" ] || [ "$BRANCH" == "develop" ] ; then - # Using the commit SHA will ensure that built images persist on - # Docker Hub unless explicitly removed. A more meaningful tag - # is also created using the - but that can be - # superseded by subsequent builds. - COMMIT_TAG=$REPO:$COMMIT - BRANCH_TAG=$REPO:$BRANCH-$VERSION - echo "Building Docker image for $COMMIT_TAG ($BRANCH_TAG)" lein uberjar - docker build -f Dockerfile -t $COMMIT_TAG . - docker tag $COMMIT_TAG $BRANCH_TAG + docker build -f Dockerfile -t $BRANCH_TAG . docker push $REPO echo "Building Docker image ... done" diff --git a/default.conf b/default.conf index 294325f..3154b61 100644 --- a/default.conf +++ b/default.conf @@ -1,6 +1,7 @@ server { listen 80; server_name localhost; + server_tokens off; location / { root /usr/share/nginx/html; diff --git a/project.clj b/project.clj index 59e1d6f..f2f5078 100644 --- a/project.clj +++ b/project.clj @@ -1,4 +1,4 @@ -(defproject lcmap-mastodon "4.2.4" +(defproject lcmap-mastodon "4.3.0" :description "Functions for LCMAP data curation" :url "https://eros.usgs.gov" :license {:name "Unlicense"