You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by de...@apache.org on 2022/10/13 16:09:24 UTC

[shenyu-website] branch main updated: Update deployment-docker.md (#799)

This is an automated email from the ASF dual-hosted git repository.

dengliming pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/shenyu-website.git


The following commit(s) were added to refs/heads/main by this push:
     new 83047a77354 Update deployment-docker.md (#799)
83047a77354 is described below

commit 83047a7735477987ef3c3dfa34429a85fb2c4492
Author: Sinsy <55...@qq.com>
AuthorDate: Fri Oct 14 00:09:18 2022 +0800

    Update deployment-docker.md (#799)
---
 .../version-2.5.0/deployment/deployment-docker.md  | 34 +++++++++++++++++-----
 1 file changed, 27 insertions(+), 7 deletions(-)

diff --git a/versioned_docs/version-2.5.0/deployment/deployment-docker.md b/versioned_docs/version-2.5.0/deployment/deployment-docker.md
index 62a8aa7c215..edffa33b54b 100644
--- a/versioned_docs/version-2.5.0/deployment/deployment-docker.md
+++ b/versioned_docs/version-2.5.0/deployment/deployment-docker.md
@@ -25,37 +25,56 @@ This article introduces the use of `docker` to deploy the `Apache ShenYu` gatewa
 * use `MySQL` to store data, follow the [guide document](./deployment-before.md#mysql) to initialize the database, copy [mysql-connector.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.29/mysql-connector-java-8.0.29.jar) to `/$(your_work_dir)/ext-lib`:
 
 ```
-docker run -v /${your_work_dir}/ext-lib:/opt/shenyu-admin/ext-lib -e "SPRING_PROFILES_ACTIVE=mysql" -e "spring.datasource.url=jdbc:mysql://${your_ip_port}/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull" -e "spring.datasource.username=${your_username}" -e "spring.datasource.password=${your_password}" -d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
+docker run -v /${your_work_dir}/ext-lib:/opt/shenyu-admin/ext-lib \
+-e "SPRING_PROFILES_ACTIVE=mysql" \
+-e "spring.datasource.url=jdbc:mysql://${your_ip_port}/shenyuuseUnicode=true&characterEncoding=utf8 \
+&useSSL=false&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull" \
+-e "spring.datasource.username=${your_username}" \
+-e "spring.datasource.password=${your_password}" \
+-d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
 ```
 
 another way is to put the `application.yml`、`application-mysql.yml`、`application-pg.yml`、`application-oracle.yml` configuration in  ${your_work_dir}/conf from [Configure address](https://github.com/apache/shenyu/blob/master/shenyu-admin/src/main/resources/) , modify the configuration `spring.profiles.active = mysql` in `application.yml`, and then execute the following statement:
 
 ```          
-docker run -v ${your_work_dir}/conf:/opt/shenyu-admin/conf -v /${your_work_dir}/ext-lib:/opt/shenyu-admin/ext-lib -d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
+docker run -v ${your_work_dir}/conf:/opt/shenyu-admin/conf \
+-v /${your_work_dir}/ext-lib:/opt/shenyu-admin/ext-lib \
+-d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
 ```
 
 * use `PostgreSql` to store data, follow the [guide document](./deployment-before.md#postgresql) to initialize the database, execute the following statement:
 
 ```
-docker run -e "SPRING_PROFILES_ACTIVE=pg" -e "spring.datasource.url=jdbc:postgresql://${your_ip_port}/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false" -e "spring.datasource.username=${your_username}" -e "spring.datasource.password=${your_password}" -d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
+docker run -e "SPRING_PROFILES_ACTIVE=pg" \
+-e "spring.datasource.url=jdbc:postgresql://${your_ip_port}/shenyu?useUnicode=true&characterEncoding=utf-8&useSSL=false" \
+-e "spring.datasource.username=${your_username}" \
+-e "spring.datasource.password=${your_password}" \
+-d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
 ```
 
 another way is to put the `application.yml`、`application-mysql.yml`、`application-pg.yml`、`application-oracle.yml` configuration in ${your_work_dir}/conf, modify the configuration `spring.profiles.active = pg` in `application.yml`,and then execute the following statement:
 
 ```
-docker run -v ${your_work_dir}/conf:/opt/shenyu-admin/conf -d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
+docker run -v ${your_work_dir}/conf:/opt/shenyu-admin/conf \
+-d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
 ```
 
 * use `Oracle` to store data, follow the [guide document](./deployment-before.md#oracle) to initialize the database, execute the following statement:
 
 ```
-docker run -e "SPRING_PROFILES_ACTIVE=oracle" -e "spring.datasource.url=jdbc:oracle:thin:@localhost:1521/shenyu" -e "spring.datasource.username=${your_username}" -e "spring.datasource.password=${your_password}" -d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
+docker run -e "SPRING_PROFILES_ACTIVE=oracle" 
+-e "spring.datasource.url=jdbc:oracle:thin:@localhost:1521/shenyu" \
+-e "spring.datasource.username=${your_username}" \
+-e "spring.datasource.password=${your_password}" \
+-d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
 ```
 
 another way is to put the `application.yml`、`application-mysql.yml`、`application-pg.yml`、`application-oracle.yml` configuration in ${your_work_dir}/conf, modify the configuration `spring.profiles.active = oracle` in `application.yml`, and then execute the following statement:
 
 ```
-docker run -v ${your_work_dir}/conf:/opt/shenyu-admin/conf -d -p 9095:9095 --net shenyu apache/shenyu-admin:${current.version}
+docker run -v ${your_work_dir}/conf:/opt/shenyu-admin/conf 
+-d -p 9095:9095 \
+--net shenyu apache/shenyu-admin:${current.version}
 ```
 
 ### Start Apache ShenYu Bootstrap
@@ -66,6 +85,7 @@ In the host, the directory where the bootstrap [configuration file](https://gith
 > docker network create shenyu
 > docker pull apache/shenyu-bootstrap:${current.version}
 > docker run -d \
-  -p 9195:9195 \  -v $BOOTSTRAP_CONF:/opt/shenyu-bootstrap/conf \
+  -p 9195:9195 \ 
+  -v $BOOTSTRAP_CONF:/opt/shenyu-bootstrap/conf \
   apache/shenyu-bootstrap:${current.version}
 ```