diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..630bf4b1 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +# use gradle 7.6, jdk-11 like video on d2l +FROM gradle:7.6-jdk11 AS builder +WORKDIR /home/gradle/project + +# Copy all project files into the container +COPY . . + +# Update the package lists to fetch the latest versions of available packages +RUN apt-get update + +# installing necessary dependencies +RUN apt-get install -y python3 python3-pip curl unzip +#cleaned up so more image layers arent present + +# cleaning up the cache to make the imahe as small as possible +RUN apt-get clean + +# clean and build project, avoid the daemon +RUN gradle clean build --no-daemon --refresh-dependencies + +# tomcat base img, jdk 11 use again +FROM tomcat:9-jre11 + +# working dir inside tomcat container +WORKDIR /usr/local/tomcat/webapps + +# take out default ROOT app if there is any +RUN rm -rf ROOT + +# copy war file that was built from initial stage to tomcat webapps directory, renamed to ROOT +COPY --from=builder /home/gradle/project/build/libs/*.war ./ROOT.war + +# Expose port 8080 so the application can be accessed from outside the container +EXPOSE 8080 \ No newline at end of file diff --git a/build.gradle b/build.gradle index ff7b120e..825bba95 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,8 @@ plugins { // gretty is a gradle plugin to make it easy to run a server and hotswap code at runtime. // https://plugins.gradle.org/plugin/org.gretty - id 'org.gretty' version '3.0.4' + id 'org.gretty' version "3.1.5" + //had to update gradle version as previous version was outdated // provides access to a database versioning tool. id "org.flywaydb.flyway" version "6.0.8" diff --git a/docs/BDD_video.mp4 b/docs/BDD_video.mp4 index 27c4646c..571239ed 100644 Binary files a/docs/BDD_video.mp4 and b/docs/BDD_video.mp4 differ