This is an automated email from the ASF dual-hosted git repository.
tianxiaoliang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git
The following commit(s) were added to refs/heads/master by this push:
new 7a0839d SCB-2176 Add containerized UX scripts (#968)
7a0839d is described below
commit 7a0839ddebf54e0015ebfebebf47f1c9f038b3a0
Author: little-cui <[email protected]>
AuthorDate: Mon May 10 09:52:35 2021 +0800
SCB-2176 Add containerized UX scripts (#968)
* feat(ux): 新版前台界面
control-panel 修改为ux
包含服务管理和配置管理两个模块
* feat(ux): 新版前台界面
review修改
* SCB-2176 Add containerized UX scripts
Co-authored-by: tuan <>
---
ux/Dockerfile | 7 +++++++
ux/README.md | 4 ++--
ux/build.sh | 37 +++++++++++++++++++++++++++++++++++++
ux/docker-compose.yml | 11 ++++++++++-
ux/etc/nginx/nginx.conf | 28 ++++++++++++++++++++++++++++
ux/etc/nginx/server.conf | 17 +++++++++++++++++
6 files changed, 101 insertions(+), 3 deletions(-)
diff --git a/ux/Dockerfile b/ux/Dockerfile
new file mode 100644
index 0000000..54b5092
--- /dev/null
+++ b/ux/Dockerfile
@@ -0,0 +1,7 @@
+FROM nginx:stable-alpine
+
+COPY ./dist/ux /usr/share/nginx/html
+COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf
+COPY ./etc/nginx/server.conf /etc/nginx/conf.d/default.conf
+
+EXPOSE 4200
diff --git a/ux/README.md b/ux/README.md
index 4b1cc77..341331b 100644
--- a/ux/README.md
+++ b/ux/README.md
@@ -9,8 +9,8 @@
### With docker:
Require:
-1. docker-compose v1.29.0+
-1. docker v18.02+
+1. docker-compose v1.29.0+, installation guide refer
[here](https://docs.docker.com/compose/install/#install-compose)
+1. docker v18.02+, installation guide refer
[here](https://docs.docker.com/desktop/#download-and-install)
Run this command:
```bash
diff --git a/ux/build.sh b/ux/build.sh
new file mode 100644
index 0000000..d65cd88
--- /dev/null
+++ b/ux/build.sh
@@ -0,0 +1,37 @@
+#!/usr/bin/env bash
+
+#
+# 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.
+#
+
+set -e
+
+umask 027
+
+SCRIPT_DIR=$(cd $(dirname $0); pwd)
+
+# build all
+export RELEASE=${1:-"latest"}
+
+# go to the script directory
+cd $SCRIPT_DIR
+
+# start
+npm install
+ng build --prod
+
+# containerized
+docker build --no-cache -t servicecomb/ux:$RELEASE .
diff --git a/ux/docker-compose.yml b/ux/docker-compose.yml
index b67b286..82bd59c 100644
--- a/ux/docker-compose.yml
+++ b/ux/docker-compose.yml
@@ -62,4 +62,13 @@ services:
depends_on:
mongo_cfg:
condition: service_completed_successfully
- # TODO give me UI here!!!
\ No newline at end of file
+ ux:
+ image: servicecomb/ux:latest
+ container_name: ux
+ ports:
+ - 4200:4200
+ depends_on:
+ service-center:
+ condition: service_started
+ kie:
+ condition: service_started
\ No newline at end of file
diff --git a/ux/etc/nginx/nginx.conf b/ux/etc/nginx/nginx.conf
new file mode 100644
index 0000000..8f6cb21
--- /dev/null
+++ b/ux/etc/nginx/nginx.conf
@@ -0,0 +1,28 @@
+user root;
+worker_processes auto;
+
+error_log /var/log/nginx/error.log notice;
+pid /var/run/nginx.pid;
+
+events {
+ worker_connections 1024;
+}
+
+http {
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ log_format main '$remote_addr - $remote_user [$time_local] "$request" '
+ '$status $body_bytes_sent "$http_referer" '
+ '"$http_user_agent" "$http_x_forwarded_for"';
+
+ access_log /var/log/nginx/access.log main;
+
+ sendfile on;
+ #tcp_nopush on;
+
+ keepalive_timeout 65;
+
+ #gzip on;
+ include /etc/nginx/conf.d/*.conf;
+}
diff --git a/ux/etc/nginx/server.conf b/ux/etc/nginx/server.conf
new file mode 100644
index 0000000..1d39d17
--- /dev/null
+++ b/ux/etc/nginx/server.conf
@@ -0,0 +1,17 @@
+server {
+ listen 4200;
+ server_name localhost;
+
+ location / {
+ root /usr/share/nginx/html;
+ index index.html index.htm;
+ }
+
+ # reverse proxy
+ location /api/v1 {
+ proxy_pass http://kie:30110/v1;
+ }
+ location /api/v4 {
+ proxy_pass http://service-center:30100/v4;
+ }
+}