diff --git a/build.gradle b/build.gradle index 9a9dc9bb..29a99ef1 100644 --- a/build.gradle +++ b/build.gradle @@ -55,10 +55,6 @@ apply plugin: 'application' mainClassName = 'org.apache.pulsar.manager.PulsarManagerApplication' -startScripts { - classpath = files('$APP_HOME/lib/*') -} - task licenseFormatNode(type: com.hierynomus.gradle.license.tasks.LicenseFormat) { source = fileTree(dir: "src").include("**/*") source = fileTree(dir: "front-end/src").include("**/*") diff --git a/front-end/docker/conf.d/default.conf b/front-end/docker/conf.d/default.conf new file mode 100644 index 00000000..f5cb568d --- /dev/null +++ b/front-end/docker/conf.d/default.conf @@ -0,0 +1,11 @@ +server { + listen 80; + server_name localhost; + root /usr/share/nginx/html; + location / { + index index.html index.htm; + } + location /pulsar-manager/ { + proxy_pass http://host.docker.internal:7750; + } +} \ No newline at end of file diff --git a/front-end/docker/docker.sh b/front-end/docker/docker.sh new file mode 100755 index 00000000..a60c0bbe --- /dev/null +++ b/front-end/docker/docker.sh @@ -0,0 +1,13 @@ +#! /bin/sh + +ROOT_DIR=$(git rev-parse --show-toplevel) +CONTAINER_NAME="pulsar-manager-ui" +CONTAINER_ID=$(docker ps | grep $CONTAINER_NAME | awk '{print $1}') + +if [ -n "$CONTAINER_ID" ]; then + docker exec -it $CONTAINER_NAME nginx -s reload +else + docker run --name $CONTAINER_NAME -p 80:80 -v $ROOT_DIR/front-end/dist:/usr/share/nginx/html -v $ROOT_DIR/front-end/docker/conf.d:/etc/nginx/conf.d nginx:1.18.0-alpine +fi + +echo "Website is running: http://localhost" diff --git a/front-end/src/router/index.js b/front-end/src/router/index.js index 7fb47360..e9010ba9 100644 --- a/front-end/src/router/index.js +++ b/front-end/src/router/index.js @@ -77,7 +77,7 @@ export const constantRouterMap = [ ] export default new Router({ - mode: 'history', // require service support + // mode: 'history', // require service support scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap })