-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (32 loc) · 1.03 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM openjdk:11
LABEL maintainer="[email protected]"
ARG EXECUTABLE_JAR
ENV JMX_PORT 5678
WORKDIR /opt/scalecube
ENV DEFAULT_JAVA_OPTS="-server \
-XX:+DisableExplicitGC \
-Dsun.rmi.dgc.client.gcInterval=3600000 \
-Dsun.rmi.dgc.server.gcInterval=3600000"
ENV DEFAULT_JMX_OPTS="-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Dcom.sun.management.jmxremote.local.only=false \
-Djava.rmi.server.hostname=127.0.0.1"
ENV DEFAULT_OOM_OPTS="-XX:+HeapDumpOnOutOfMemoryError \
-XX:HeapDumpPath=scalecube-seed-oom.hprof \
-XX:+UseGCOverheadLimit"
COPY target/lib lib
COPY target/${EXECUTABLE_JAR}.jar app.jar
# jmx server port
EXPOSE $JMX_PORT
# Cluster control port and communication port.
EXPOSE 4801 4802
ENTRYPOINT exec java \
$DEFAULT_JAVA_OPTS \
$JAVA_OPTS \
$DEFAULT_JMX_OPTS \
$DEFAULT_OOM_OPTS \
-Dcom.sun.management.jmxremote.port=$JMX_PORT \
-Dcom.sun.management.jmxremote.rmi.port=$JMX_PORT \
-Dlog4j.configurationFile=log4j2.xml \
-jar app.jar $PROGRAM_ARGS