mirror of
https://github.com/iSoron/uhabits.git
synced 2025-12-06 09:08:52 -06:00
Add docker tasks to gradle
This commit is contained in:
10
server/Dockerfile
Normal file
10
server/Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM openjdk:8-jre-alpine
|
||||||
|
RUN mkdir /app
|
||||||
|
COPY uhabits-server.jar /app/uhabits-server.jar
|
||||||
|
WORKDIR /app
|
||||||
|
CMD ["java", \
|
||||||
|
"-server", \
|
||||||
|
"-XX:MaxGCPauseMillis=100", \
|
||||||
|
"-XX:+UseStringDeduplication", \
|
||||||
|
"-jar", \
|
||||||
|
"uhabits-server.jar"]
|
||||||
@@ -21,14 +21,19 @@ buildscript {
|
|||||||
repositories {
|
repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
classpath "com.github.jengelman.gradle.plugins:shadow:5.2.0"
|
||||||
|
classpath "com.palantir.gradle.docker:gradle-docker:0.25.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'kotlin'
|
apply plugin: 'kotlin'
|
||||||
|
apply plugin: "com.github.johnrengelman.shadow"
|
||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
apply plugin: "com.palantir.docker"
|
||||||
|
apply plugin: "com.palantir.docker-run"
|
||||||
|
|
||||||
group 'org.isoron.uhabits'
|
group 'org.isoron.uhabits'
|
||||||
version '0.0.1'
|
version '0.0.1'
|
||||||
@@ -59,3 +64,21 @@ dependencies {
|
|||||||
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
|
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
|
||||||
testImplementation "org.mockito:mockito-core:2.+"
|
testImplementation "org.mockito:mockito-core:2.+"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
shadowJar {
|
||||||
|
baseName = 'uhabits-server'
|
||||||
|
classifier = null
|
||||||
|
version = null
|
||||||
|
}
|
||||||
|
|
||||||
|
docker {
|
||||||
|
name = "uhabits-server:$version"
|
||||||
|
files "build/libs/uhabits-server.jar"
|
||||||
|
}
|
||||||
|
|
||||||
|
dockerRun {
|
||||||
|
name = 'uhabits-server'
|
||||||
|
image "uhabits-server:$version"
|
||||||
|
ports '8080:8080'
|
||||||
|
arguments '--restart=always'
|
||||||
|
}
|
||||||
@@ -17,4 +17,4 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
rootProject.name = "syncserver"
|
rootProject.name = "uhabits-server"
|
||||||
|
|||||||
Reference in New Issue
Block a user