diff --git a/docs/docs/user_docs/ops/server-docker.md b/docs/docs/user_docs/ops/server-docker.md index e3e6abd5..6eca1e89 100644 --- a/docs/docs/user_docs/ops/server-docker.md +++ b/docs/docs/user_docs/ops/server-docker.md @@ -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 diff --git a/hippo4j-server/Dockerfile b/hippo4j-server/Dockerfile index 3a215218..e53fe44c 100644 --- a/hippo4j-server/Dockerfile +++ b/hippo4j-server/Dockerfile @@ -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 \ "] \ No newline at end of file