feat: Only the datasource parameter is exposed (#550)

pull/551/head
BigXin0109 2 years ago committed by GitHub
parent 7467ea634c
commit fcb44dc026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -38,9 +38,12 @@ docker pull hippo4j-server
docker run -p 6691:6691 --name hippo4j-server -d hippo4j-server:{指定版本}
/**
* 如需自定义 mysql 等配置,可通过 "-e PARAMS" 指定,参数格式 PARAMS="--key=value --key2=value2"
* 配置项参考文件:/hippo4j-server/src/main/resources/application.properties
* 如需自定义 JVM内存参数 等配置,可通过 "-e JAVA_OPTS" 指定,参数格式 JAVA_OPTS="-Xmx512m"
* 暂时只暴露以下参数
* MYSQL_DATASOURCE_URL、MYSQL_USERNAME、MYSQL_PASSWORD
*/
docker run -e PARAMS="--spring.datasource.url=jdbc:mysql://localhost:3306/hippo4j_manager?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8" -p 6691:6691 --name hippo4j-server -d hippo4j-server:{指定版本}
docker run -p 6691:6691 --name hippo4j-server \
-e MYSQL_DATASOURCE_URL=127.0.0.1:3306/hippo4j_manager \
-e MYSQL_USERNAME=root \
-e MYSQL_PASSWORD=mysql \
-d hippo4j-server
```

@ -17,14 +17,29 @@
FROM openjdk:8-jre-slim
MAINTAINER lijianxin
ENV PARAMS=""
ENV MYSQL_DATASOURCE_URL="127.0.0.1:3306/hippo4j_manager" \
MYSQL_USERNAME="root" \
MYSQL_PASSWORD="root" \
BASE_DIR="/opt/hippo4j"
ENV TZ=PRC
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ADD conf/hippo4j-logback.xml /opt/hippo4j/logback.xml
ADD target/hippo4j-server.jar /opt/hippo4j/hippo4j-server.jar
ADD conf/hippo4j-logback.xml ${BASE_DIR}/logback.xml
ADD target/hippo4j-server.jar ${BASE_DIR}/hippo4j-server.jar
WORKDIR /opt/hippo4j
WORKDIR ${BASE_DIR}
ENTRYPOINT ["sh","-c","java -jar -Dhippo4j.home=/opt/hippo4j $JAVA_OPTS /opt/hippo4j/hippo4j-server.jar --server.tomcat.basedir=/opt/tomcat --logging.config=/opt/hippo4j/logback.xml $PARAMS"]
ENTRYPOINT ["sh","-c","java -jar \
-Xloggc:${BASE_DIR}/hippo4j_gc.log -verbose:gc -XX:+PrintGCDetails \
-XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+UseGCLogFileRotation \
-XX:NumberOfGCLogFiles=10 -XX:GCLogFileSize=100M \
-XX:-OmitStackTraceInFastThrow -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=${BASE_DIR}/java_heapdump.hprof \
-Xms1024m -Xmx1024m -Xmn512m \
-Dhippo4j.standalone=true -Dhippo4j.home=${BASE_DIR} \
hippo4j-server.jar \
--server.max-http-header-size=524288 --server.tomcat.basedir=${BASE_DIR}/tomcat/ \
--logging.config=${BASE_DIR}/logback.xml \
--spring.datasource.url=\"jdbc:mysql://$MYSQL_DATASOURCE_URL?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8\" \
--spring.datasource.username=$MYSQL_USERNAME --spring.datasource.password=$MYSQL_PASSWORD \
"]
Loading…
Cancel
Save