build.gradle 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. apply plugin: 'docker'
  2. apply plugin: 'application'
  3. buildscript {
  4. repositories {
  5. mavenCentral()
  6. }
  7. dependencies {
  8. classpath('se.transmode.gradle:gradle-docker:1.2')
  9. }
  10. }
  11. dependencies {
  12. compile project(":zen-api")
  13. compile project(':cloud-bus')
  14. compile project(':fastdfs-client')
  15. }
  16. docker{
  17. baseImage 'openjdk:8-jre-alpine'
  18. maintainer 'tina 976056042@qq.com'
  19. registry 'registry.cn-qingdao.aliyuncs.com'
  20. }
  21. task dockerBuilder(type: Docker) {
  22. registry='registry.cn-qingdao.aliyuncs.com/gxzc-envir'
  23. applicationName = 'fw'
  24. tagVersion = jar.version
  25. addFile("./${jar.baseName}-${jar.version}.jar","app.jar")
  26. entryPoint(["java","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-Djava.security.egd=file:/dev/./urandom","-Duser.timezone=GMT+08","-jar",'app.jar'])
  27. exposePort(11000)
  28. doFirst {
  29. copy {
  30. from jar
  31. into stageDir
  32. }
  33. }
  34. push = true
  35. }
  36. dockerBuilder.dependsOn(bootJar)
  37. bootJar { enabled = true }
  38. jar { enabled = false }