diff --git a/Dockerfile b/Dockerfile index fecaa75a1eaa0163145110a51aa6e843ee10bbd3..fb54fd9f701bbcc0df8408f42672f6b4e69a58fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,10 +16,15 @@ LABEL io.k8s.description="Platform for building and running Spring Boot applicat io.openshift.tags="builder,java,java8,maven,maven3,springboot" RUN yum update -y && \ - yum install -y curl && \ + yum install -y curl epel-release && \ yum install -y java-$JAVA_VERSON-openjdk java-$JAVA_VERSON-openjdk-devel && \ yum clean all +RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - + +RUN yum install nodejs gcc-c++ make && \ + yum clean all && npm install -f @angular/cli + RUN curl -fsSL https://archive.apache.org/dist/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar xzf - -C /usr/share \ && mv /usr/share/apache-maven-$MAVEN_VERSION /usr/share/maven \ && ln -s /usr/share/maven/bin/mvn /usr/bin/mvn diff --git a/README.md b/README.md index a16f951638f139961d5e34345a1d20ee377a8e19..50ce04a172d2baf5770dad48866cc6d72f2393fe 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Spring Boot - Maven 3 - CentOS Docker image +# Spring Boot - Maven 3 + Typescript Angular - CentOS Docker image [](https://travis-ci.org/codecentric/springboot-maven3-centos) diff --git a/s2i/bin/assemble b/s2i/bin/assemble index 8021fb50ca6fa37026baa405bce87f950583e7b0..61127e83721fa13868bb147fe85e03d9cd282ef2 100755 --- a/s2i/bin/assemble +++ b/s2i/bin/assemble @@ -3,7 +3,15 @@ set -e echo "---> Installing application source" -cp -Rf /tmp/src/. ./ +cp -Rf /tmp/. ./ +echo "---> Cleaning eventually static files hosted in src/...." +rm -rf ./src/main/resources/static/* + +echo "---> Building static files" +cd static +npm install +ng build --prod +mv ./dist/* ../src/main/resources/static/ echo "---> Building Spring Boot application from source" echo "--> # MVN_ARGS = $MVN_ARGS"