lvshaokang commented on code in PR #1817:
URL: 
https://github.com/apache/incubator-streampark/pull/1817#discussion_r992943055


##########
deploy/docker/.env:
##########
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+HUB=apache/streampark
+TAG=latest
+
+TZ=Asia/Shanghai
+SPRING_PROFILES_ACTIVE=h2
+FLINK=flink1.14.5
+FLINK_PROPERTIES=jobmanager.rpc.address: jobmanager
+FLINK_VERSION=1.14.5
+COMMAND_MYSQL=/bin/sh -c "bash bin/startup.sh"

Review Comment:
   suggest `COMMAND_MYSQL` rename to `COMMAND`



##########
deploy/docker/mysql/.env:
##########
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+HUB=apache/streampark
+TAG=latest
+
+TZ=Asia/Shanghai
+SPRING_PROFILES_ACTIVE=mysql
+SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/streampark?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
+SPRING_DATASOURCE_USERNAME=root
+SPRING_DATASOURCE_PASSWORD=streampark
+FLINK=flink1.14.5
+FLINK_PROPERTIES=jobmanager.rpc.address: jobmanager
+FLINK_VERSION=1.14.5

Review Comment:
   Use full image tag



##########
deploy/docker/mysql/.env:
##########
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+HUB=apache/streampark
+TAG=latest
+
+TZ=Asia/Shanghai
+SPRING_PROFILES_ACTIVE=mysql
+SPRING_DATASOURCE_URL=jdbc:mysql://localhost:3306/streampark?useSSL=false&useUnicode=true&characterEncoding=UTF-8&allowPublicKeyRetrieval=false&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=GMT%2B8
+SPRING_DATASOURCE_USERNAME=root
+SPRING_DATASOURCE_PASSWORD=streampark
+FLINK=flink1.14.5
+FLINK_PROPERTIES=jobmanager.rpc.address: jobmanager
+FLINK_VERSION=1.14.5
+COMMAND_MYSQL=/bin/sh -c "wget 
https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.30.tar.gz
 && tar -zxvf mysql-connector-java-8.0.30.tar.gz && cp 
mysql-connector-java-8.0.30/mysql-connector-java-8.0.30.jar lib && bash 
bin/startup.sh"

Review Comment:
   suggest COMMAND_MYSQL rename to COMMAND



##########
deploy/docker/.env:
##########
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+HUB=apache/streampark
+TAG=latest
+
+TZ=Asia/Shanghai
+SPRING_PROFILES_ACTIVE=h2
+FLINK=flink1.14.5
+FLINK_PROPERTIES=jobmanager.rpc.address: jobmanager
+FLINK_VERSION=1.14.5

Review Comment:
   Use full image tag



##########
deploy/docker/docker-compose.yaml:
##########
@@ -1,83 +1,65 @@
-###############################################################################
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-###############################################################################
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 version: '3.8'
 services:
   streampark-server:
-    build:
-      context: ../..
-      dockerfile: deploy/docker/compose/Dockerfile
-      args:
-        DB: database
+    image: ${HUB}/streampark:${TAG}
+    command: ${COMMAND_MYSQL}
     ports:
       - 10000:10000
-    depends_on:
-      - database
+    env_file: .env
     volumes:
-      - flink1.14.5:/  streampark/flink/flink1.14.5
+      - flink:/streampark/flink/${FLINK}
+      - /var/run/docker.sock:/var/run/docker.sock
+      - /etc/hosts:/etc/hosts:ro
+      - ~/.kube:/root/.kube:ro
     restart: unless-stopped
+    networks:
+      - streampark
 
-  database:
-    build:
-      context: ../..
-      dockerfile: deploy/docker/mysql/Dockerfile
-    command: mysqld --character-set-server=utf8mb4 
--collation-server=utf8mb4_unicode_ci
-    ports:
-      - 3306:3306
-    volumes:
-      - mysql-data:/var/lib/mysql
-    environment:
-      MYSQL_ROOT_PASSWORD: 123456
-      MYSQL_ROOT_HOST: '%'
-      MYSQL_DATABASE: streampark
-      MYSQL_USER: streampark
-      MYSQL_PASSWORD: 123456
-    healthcheck:
-      test: [ "CMD", "mysqladmin" ,"-uroot","-p123456","ping", "-h", 
"localhost" ]
-      timeout: 20s
-      retries: 10
-    restart: unless-stopped
 
   jobmanager:
-    image: flink:1.14.5-scala_2.12
+    image: flink:${FLINK_VERSION}-scala_2.12

Review Comment:
   I see that the image tag here only specifies the `FLINK_VERSION` 
environment, suggest using the full image tag rather than a part of it, such 
as, FLINK_TAG=1.14.5-scala_2.12



##########
deploy/docker/docker-compose.yaml:
##########
@@ -1,83 +1,65 @@
-###############################################################################
-#  Licensed to the Apache Software Foundation (ASF) under one or more
-#  contributor license agreements.  See the NOTICE file distributed with
-#  this work for additional information regarding copyright ownership.
-#  The ASF licenses this file to You under the Apache License, Version 2.0
-#  (the "License"); you may not use this file except in compliance with
-#  the License.  You may obtain a copy of the License at
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
 #
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
-#  Unless required by applicable law or agreed to in writing, software
-#  distributed under the License is distributed on an "AS IS" BASIS,
-#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-#  See the License for the specific language governing permissions and
-#  limitations under the License.
-###############################################################################
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 version: '3.8'
 services:
   streampark-server:
-    build:
-      context: ../..
-      dockerfile: deploy/docker/compose/Dockerfile
-      args:
-        DB: database
+    image: ${HUB}/streampark:${TAG}
+    command: ${COMMAND_MYSQL}
     ports:
       - 10000:10000
-    depends_on:
-      - database
+    env_file: .env
     volumes:
-      - flink1.14.5:/  streampark/flink/flink1.14.5
+      - flink:/streampark/flink/${FLINK}
+      - /var/run/docker.sock:/var/run/docker.sock
+      - /etc/hosts:/etc/hosts:ro
+      - ~/.kube:/root/.kube:ro
     restart: unless-stopped
+    networks:
+      - streampark
 
-  database:
-    build:
-      context: ../..
-      dockerfile: deploy/docker/mysql/Dockerfile
-    command: mysqld --character-set-server=utf8mb4 
--collation-server=utf8mb4_unicode_ci
-    ports:
-      - 3306:3306
-    volumes:
-      - mysql-data:/var/lib/mysql
-    environment:
-      MYSQL_ROOT_PASSWORD: 123456
-      MYSQL_ROOT_HOST: '%'
-      MYSQL_DATABASE: streampark
-      MYSQL_USER: streampark
-      MYSQL_PASSWORD: 123456
-    healthcheck:
-      test: [ "CMD", "mysqladmin" ,"-uroot","-p123456","ping", "-h", 
"localhost" ]
-      timeout: 20s
-      retries: 10
-    restart: unless-stopped
 
   jobmanager:
-    image: flink:1.14.5-scala_2.12
+    image: flink:${FLINK_VERSION}-scala_2.12
     ports:
       - "8081:8081"
     command: jobmanager
     volumes:
-      - flink1.14.5:/opt/flink
-    environment:
-      - |
-        FLINK_PROPERTIES=
-        jobmanager.rpc.address: jobmanager
+      - flink:/opt/flink
+    env_file: .env
     restart: unless-stopped
+    networks:
+      - streampark
+
 
   taskmanager:
-    image: flink:1.14.5-scala_2.12
+    image: flink:${FLINK_VERSION}-scala_2.12

Review Comment:
   the same



##########
deploy/README.md:
##########
@@ -1,74 +0,0 @@
-# StreamPark on Docker and Kubernetes Quick Start

Review Comment:
   Why remove this, has the docker README been migrated elsewhere? If migrating 
elsewhere, it is recommended that the path to the new documentation be declared 
in README.md, rather than remove it, such as,
   
   # StreamPark For Docker
   
   * [StreamPark Start With Docker](http://xxx)



##########
deploy/docker/pgsql/.env:
##########
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+HUB=apache/streampark
+TAG=latest
+
+TZ=Asia/Shanghai
+SPRING_PROFILES_ACTIVE=pgsql
+SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/streampark?stringtype=unspecified
+SPRING_DATASOURCE_USERNAME=postgres
+SPRING_DATASOURCE_PASSWORD=streampark
+FLINK=flink1.14.5
+FLINK_PROPERTIES=jobmanager.rpc.address: jobmanager
+FLINK_VERSION=1.14.5

Review Comment:
   Use full image tag



##########
deploy/docker/pgsql/.env:
##########
@@ -0,0 +1,30 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+HUB=apache/streampark
+TAG=latest
+
+TZ=Asia/Shanghai
+SPRING_PROFILES_ACTIVE=pgsql
+SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/streampark?stringtype=unspecified
+SPRING_DATASOURCE_USERNAME=postgres
+SPRING_DATASOURCE_PASSWORD=streampark
+FLINK=flink1.14.5
+FLINK_PROPERTIES=jobmanager.rpc.address: jobmanager
+FLINK_VERSION=1.14.5
+COMMAND_MYSQL=/bin/sh -c "wget 
https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.30.tar.gz
 && tar -zxvf mysql-connector-java-8.0.30.tar.gz && cp 
mysql-connector-java-8.0.30/mysql-connector-java-8.0.30.jar lib && bash 
bin/startup.sh"

Review Comment:
   suggest COMMAND_MYSQL rename to COMMAND



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to