feat: dockerfile datasource host port db exposed. (#551)

* feat: dockerfile datasource host port db exposed.

* feat: dockerfile datasource host default value.

* feat: dockerfile datasource host default value.

* fix: remove space
pull/556/head
BigXin0109 2 years ago committed by GitHub
parent fcb44dc026
commit dad9fb5c6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -39,10 +39,12 @@ docker run -p 6691:6691 --name hippo4j-server -d hippo4j-server:{指定版本}
/**
* 暂时只暴露以下参数
* MYSQL_DATASOURCE_URL、MYSQL_USERNAME、MYSQL_PASSWORD
* MYSQL_HOST、MYSQL_PORT、MYSQL_DB、MYSQL_USERNAME、MYSQL_PASSWORD
*/
docker run -p 6691:6691 --name hippo4j-server \
-e MYSQL_DATASOURCE_URL=127.0.0.1:3306/hippo4j_manager \
-e MYSQL_HOST=127.0.0.1 \
-e MYSQL_PORT=3306 \
-e MYSQL_DB=hippo4j_manager \
-e MYSQL_USERNAME=root \
-e MYSQL_PASSWORD=mysql \
-d hippo4j-server

@ -17,7 +17,9 @@
FROM openjdk:8-jre-slim
MAINTAINER lijianxin
ENV MYSQL_DATASOURCE_URL="127.0.0.1:3306/hippo4j_manager" \
ENV MYSQL_HOST="127.0.0.1" \
MYSQL_PORT="3306" \
MYSQL_DB="hippo4j_manager" \
MYSQL_USERNAME="root" \
MYSQL_PASSWORD="root" \
BASE_DIR="/opt/hippo4j"
@ -40,6 +42,6 @@ ENTRYPOINT ["sh","-c","java -jar \
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.url=\"jdbc:mysql://$MYSQL_HOST:$MYSQL_PORT/$MYSQL_DB?characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8\" \
--spring.datasource.username=$MYSQL_USERNAME --spring.datasource.password=$MYSQL_PASSWORD \
"]
Loading…
Cancel
Save