Skip to content

Commit

Permalink
feat: generate Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
kkweon committed Sep 13, 2021
1 parent 9897409 commit 2033e78
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.github
.gradle
.idea
build
.env
members.yaml
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
}
}

0 comments on commit 2033e78

Please sign in to comment.