diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9a46616 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +.github +.gradle +.idea +build +.env +members.yaml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e41663a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM openjdk:11 + +ENV APP_HOME=/codingpot +WORKDIR $APP_HOME + +COPY build.gradle.kts settings.gradle.kts gradlew $APP_HOME/ +COPY gradle $APP_HOME/gradle/ +COPY app/build.gradle $APP_HOME/app/ + +RUN ./gradlew resolveDependencies + +COPY . $APP_HOME +RUN ./gradlew build + +ENTRYPOINT java -jar app/build/libs/app.jar diff --git a/build.gradle.kts b/build.gradle.kts index 59fbfec..e263175 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -19,3 +19,16 @@ spotless { ktlint() } } + +task("resolveDependencies") { + doLast { + project.rootProject.allprojects.forEach { subProject -> + subProject.buildscript.configurations.forEach { configuration -> + if (configuration.isCanBeResolved) configuration.resolve() + } + subProject.configurations.forEach { configuration -> + if (configuration.isCanBeResolved) configuration.resolve() + } + } + } +}