build.gradle 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. buildscript {
  2. repositories {
  3. maven { url 'https://maven.aliyun.com/repository/central' }
  4. }
  5. dependencies {
  6. classpath('se.transmode.gradle:gradle-docker:1.2')
  7. }
  8. }
  9. apply plugin: 'docker'
  10. apply plugin: 'application'
  11. group 'cn.tonyandmoney.tuon'
  12. version '0.1.0'
  13. dependencies {
  14. compile project(':tuon-core')
  15. compile project(':tuon-qywx')
  16. }
  17. docker{
  18. baseImage 'openjdk:8-jre-alpine'
  19. maintainer 'tina 976056042@qq.com'
  20. registry 'docker.tonyandmoney.cn'
  21. }
  22. task dockerBuilder(type: Docker) {
  23. registry='docker.tonyandmoney.cn'
  24. applicationName = 'tuon-fw'
  25. tagVersion = jar.version
  26. addFile("./${jar.baseName}-${jar.version}.jar","app.jar")
  27. entryPoint(["java","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-Djava.security.egd=file:/dev/./urandom","-Duser.timezone=GMT+08","-jar",'app.jar'])
  28. exposePort(11000)
  29. doFirst {
  30. copy {
  31. from jar
  32. into stageDir
  33. }
  34. }
  35. push = true
  36. }
  37. dockerBuilder.dependsOn(bootJar)
  38. task innerDockerBuilder(type: Docker){
  39. registry='registry.tuonq.cn:5000'
  40. applicationName = 'tuon-fw'
  41. tagVersion = jar.version
  42. addFile("./${jar.baseName}-${jar.version}.jar","app.jar")
  43. entryPoint(["java","-XX:+UnlockExperimentalVMOptions","-XX:+UseCGroupMemoryLimitForHeap","-Djava.security.egd=file:/dev/./urandom","-Duser.timezone=GMT+08","-jar",'app.jar'])
  44. exposePort(11000)
  45. doFirst {
  46. copy {
  47. from jar
  48. into stageDir
  49. }
  50. }
  51. push = true
  52. }
  53. innerDockerBuilder.dependsOn(bootJar)
  54. bootJar { enabled = true }
  55. jar { enabled = false }