You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by hx...@apache.org on 2022/01/09 14:36:50 UTC

[iotdb-web-workbench] branch master updated (5e7d917 -> 08ab290)

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

hxd pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb-web-workbench.git.


    from 5e7d917  enable issues
     new 9c824a3  add Docker support for frontend and backend with docker compose
     new 08ab290  Adding builder for Maven to run properly

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 README.md                                          |  3 +++
 backend/Dockerfile                                 | 16 +++++++++++--
 ...plication-test.properties => docker-compose.yml | 19 +++++++++++----
 .../Dockerfile                                     | 27 ++++++++++++++++++----
 4 files changed, 53 insertions(+), 12 deletions(-)
 copy backend/src/main/resources/application-test.properties => docker-compose.yml (78%)
 copy backend/src/main/resources/application-test.properties => frontend/Dockerfile (56%)

[iotdb-web-workbench] 01/02: add Docker support for frontend and backend with docker compose

Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb-web-workbench.git

commit 9c824a38148a99a789fdab663de4d86185b9c1bb
Author: Niklas Merz <ni...@apache.org>
AuthorDate: Tue Sep 21 10:30:59 2021 +0200

    add Docker support for frontend and backend with docker compose
    
    Co-authored-by: Markus Schmidgall <Ma...@googlemail.com>
---
 README.md                                |  3 +++
 backend/Dockerfile                       | 10 ++++++++--
 backend/Dockerfile => docker-compose.yml | 17 ++++++++++++++---
 {backend => frontend}/Dockerfile         | 25 ++++++++++++++++++++++---
 4 files changed, 47 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 3a5cfff..6d6c312 100644
--- a/README.md
+++ b/README.md
@@ -25,3 +25,6 @@
 
 This code repo is a web based workbench for [Apache IoTDB](https://iotdb.apache.org)
 
+## Docker
+
+`docker-compose up -d`
\ No newline at end of file
diff --git a/backend/Dockerfile b/backend/Dockerfile
index f6e39cc..10b3078 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -19,6 +19,12 @@
 
 FROM hub.segma.tech/library/java:8-jre-centos7-apollo
 
-COPY target/service-1.0.0.jar /app/app.jar
+WORKDIR /app
 
-ENTRYPOINT ["java", "-jar", "/app/app.jar"]
+COPY . .
+
+RUN mvn package
+
+EXPOSE 8080
+
+ENTRYPOINT ["java", "-jar", "/app/workbench-1.0.0.jar"]
diff --git a/backend/Dockerfile b/docker-compose.yml
similarity index 78%
copy from backend/Dockerfile
copy to docker-compose.yml
index f6e39cc..7100e25 100644
--- a/backend/Dockerfile
+++ b/docker-compose.yml
@@ -17,8 +17,19 @@
 # under the License.
 #
 
-FROM hub.segma.tech/library/java:8-jre-centos7-apollo
+version: "3.8"
 
-COPY target/service-1.0.0.jar /app/app.jar
+services:
+  backend:
+    build: ./backend
+    restart: always
+    ports:
+      - 8081:8080
 
-ENTRYPOINT ["java", "-jar", "/app/app.jar"]
+  frontend:
+    build: ./frontend
+    restart: always
+    ports:
+      - 8080:8080
+    depends_on:
+      - backend
\ No newline at end of file
diff --git a/backend/Dockerfile b/frontend/Dockerfile
similarity index 56%
copy from backend/Dockerfile
copy to frontend/Dockerfile
index f6e39cc..356bc44 100644
--- a/backend/Dockerfile
+++ b/frontend/Dockerfile
@@ -17,8 +17,27 @@
 # under the License.
 #
 
-FROM hub.segma.tech/library/java:8-jre-centos7-apollo
+FROM node:lts-alpine
 
-COPY target/service-1.0.0.jar /app/app.jar
+# From official Vue Documentation https://vuejs.org/v2/cookbook/dockerize-vuejs-app.html
 
-ENTRYPOINT ["java", "-jar", "/app/app.jar"]
+# install simple http server for serving static content
+RUN npm install -g http-server
+
+# make the 'app' folder the current working directory
+WORKDIR /app
+
+# copy both 'package.json' and 'package-lock.json' (if available)
+COPY package*.json ./
+
+# install project dependencies
+RUN npm install
+
+# copy project files and folders to the current working directory (i.e. 'app' folder)
+COPY . .
+
+# build app for production with minification
+RUN npm run build
+
+EXPOSE 8080
+CMD [ "http-server", "dist" ]
\ No newline at end of file

[iotdb-web-workbench] 02/02: Adding builder for Maven to run properly

Posted by hx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hxd pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb-web-workbench.git

commit 08ab290d89f6fd426428c38f8c16a0af5e6e7059
Author: Markus Schmidgall <ma...@googlemail.com>
AuthorDate: Tue Sep 21 10:53:25 2021 +0200

    Adding builder for Maven to run properly
---
 backend/Dockerfile | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/backend/Dockerfile b/backend/Dockerfile
index 10b3078..62723a4 100644
--- a/backend/Dockerfile
+++ b/backend/Dockerfile
@@ -17,7 +17,7 @@
 # under the License.
 #
 
-FROM hub.segma.tech/library/java:8-jre-centos7-apollo
+FROM maven:3.8.2-amazoncorretto-8 as builder
 
 WORKDIR /app
 
@@ -25,6 +25,12 @@ COPY . .
 
 RUN mvn package
 
+
+
+FROM hub.segma.tech/library/java:8-jre-centos7-apollo
+
+COPY --from=builder /app/target/workbench-1.0.0.jar /app/workbench-1.0.0.jar
+
 EXPOSE 8080
 
 ENTRYPOINT ["java", "-jar", "/app/workbench-1.0.0.jar"]