diff --git a/Dockerfile b/Dockerfile index 1d13e50..dd6c330 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,30 +2,27 @@ # --build-arg="MVN_FINALNAME=$MVN_FINALNAME" \ # --build-arg="MVN_NAME=${MVN_NAME}" \ # --build-arg="CONTAINER_INI=${CONTAINER_INI}" \ -# --build-arg="JAVA_VERSION=${JAVA_VERSION}" \ -# --build-arg="SMARTGEARS_VERSION=${SMARTGEARS_VERSION}" \ +# --build-arg="SMARTGEAR_IMAGE=${SMARTGEAR_IMAGE}" \ +# --build-arg="PORT=${PORT}" \ # -f Dockerfile \ # $PLATFORMS . -# ARG JAVA_VERSION -# ARG SMARTGEARS_VERSION -# ARG TOMCAT_VERSION - ARG SMARTGEAR_IMAGE -#FROM d4science/smartgears-distribution:${SMARTGEARS_VERSION}-java${JAVA_VERSION}-tomcat10.1.19 -# FROM hub.dev.d4science.org/gcube/smartgears-distribution:${SMARTGEARS_VERSION}-java${JAVA_VERSION}-tomcat{TOMCAT_VERSION} FROM ${SMARTGEAR_IMAGE} - ARG CONTAINER_INI="./dockerize/configuration/container.ini" + ARG CONTAINER_INI ARG MVN_FINALNAME ARG MVN_NAME - - #FROM smartgears-distribution:${SMARTGEARS_VERSION}-java${JAVA_VERSION}-tomcat10.1.19 + ARG PORT COPY ./dockerize/configuration/logback.xml /etc/ COPY ./dockerize/configuration/*.gcubekey /tomcat/lib + COPY ./target/${MVN_FINALNAME}.war /usr/local/tomcat/webapps/ + # In the case you have to copy a file inside the service directory + # the war must be unzipped . # RUN unzip /target/${MVN_FINALNAME}.war -d /tomcat/webapps/${MVN_NAME} + COPY ${CONTAINER_INI} /etc/container.ini - EXPOSE 8080 + EXPOSE ${PORT} diff --git a/dockerize/build_conf b/dockerize/build_conf index d39b9f7..961d6f9 100644 --- a/dockerize/build_conf +++ b/dockerize/build_conf @@ -29,6 +29,9 @@ echo "JAVA_VERSION: ${JAVA_VERSION}" TOMCAT_VERSION=10.1.19 echo "TOMCAT_VERSION: ${TOMCAT_VERSION}" +PORT=8080 +echo "PORT: ${PORT}" + SMARTGEARS_VERSION=$(cd .. && mvn -q \ -Dexec.executable=echo \ -Dexec.args='${docker.smartgear.version}' \