Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #
  2. # Copyright 2016-present the original author or authors.
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # https://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. # runtime
  17. FROM registry.cn-beijing.aliyuncs.com/dc3/alpine-java:dragonwell-8.13.14 AS runtime
  18. MAINTAINER pnoker <pnokers.icloud.com>
  19. # default env
  20. ENV NODE_ENV dev
  21. ENV EUREKA_TLS_ENABLE false
  22. ENV SERVER_PORT 8400
  23. # default jvm & gc env
  24. ENV JAVA_OPS -server \
  25. -Xms128m \
  26. -Xmx1024m \
  27. -Djava.security.egd=file:/dev/./urandom \
  28. -XX:CompressedClassSpaceSize=128m \
  29. -XX:MetaspaceSize=200m \
  30. -XX:MaxMetaspaceSize=200m
  31. ENV GC_LOG -XX:+PrintGCDetails \
  32. -XX:+PrintGCDateStamps \
  33. -XX:+PrintTenuringDistribution \
  34. -XX:+PrintHeapAtGC \
  35. -XX:+PrintReferenceGC \
  36. -XX:+PrintGCApplicationStoppedTime \
  37. -XX:+UseGCLogFileRotation \
  38. -XX:NumberOfGCLogFiles=10 \
  39. -XX:GCLogFileSize=10M \
  40. -Xloggc:dc3/logs/center/manager/gc/dc3-center-manager.log
  41. RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  42. WORKDIR /dc3-center/dc3-center-manager
  43. ADD ./target/dc3-center-manager.jar ./
  44. EXPOSE ${SERVER_PORT}
  45. VOLUME /dc3-center/dc3-center-manager/dc3/logs
  46. CMD mkdir -p /dc3-center/dc3-center-manager/dc3/logs/center/manager/gc \
  47. && java ${JAVA_OPS} ${GC_LOG} -jar dc3-center-manager.jar