diff --git a/docker_init.sh b/docker_init.sh index d4f2ee9a..a8cbfeb9 100755 --- a/docker_init.sh +++ b/docker_init.sh @@ -6,10 +6,19 @@ then : else jspath=`ls /app/dist/js/app.*.js` - cp ${jspath} ${jspath}.bak sed -i "s?localhost:8000?${CRAWLAB_API_ADDRESS}?g" ${jspath} fi +# replace base url +if [ "${CRAWLAB_BASE_URL}" = "" ]; +then + : +else + indexpath=/app/dist/index.html + sed -i "s?/js/?${CRAWLAB_BASE_URL}/css/?g" ${indexpath} + sed -i "s?/css/?${CRAWLAB_BASE_URL}/css/?g" ${indexpath} +fi + # start nginx service nginx start diff --git a/jenkins/develop/docker-compose.yaml b/jenkins/develop/docker-compose.yaml index cf466671..ec95ae9f 100644 --- a/jenkins/develop/docker-compose.yaml +++ b/jenkins/develop/docker-compose.yaml @@ -4,6 +4,7 @@ services: image: "tikazyq/crawlab:develop" environment: CRAWLAB_API_ADDRESS: "crawlab.cn/dev/api" + CRAWLAB_BASE_URL: "/dev" CRAWLAB_SERVER_MASTER: "Y" CRAWLAB_MONGO_HOST: "mongo" CRAWLAB_REDIS_ADDRESS: "redis" diff --git a/jenkins/master/docker-compose.yaml b/jenkins/master/docker-compose.yaml index 0bcaee3a..7309829d 100644 --- a/jenkins/master/docker-compose.yaml +++ b/jenkins/master/docker-compose.yaml @@ -4,6 +4,7 @@ services: image: "tikazyq/crawlab:master" environment: CRAWLAB_API_ADDRESS: "crawlab.cn/api" + CRAWLAB_BASE_URL: "/demo" CRAWLAB_SERVER_MASTER: "Y" CRAWLAB_MONGO_HOST: "mongo" CRAWLAB_REDIS_ADDRESS: "redis"