mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
Merge pull request #1050 from zerafachris/BASE_URL-env-variable
CRAWLAB_BASE_URL env var in docker-compose
This commit is contained in:
@@ -1,4 +1,16 @@
|
|||||||
#!/bin/bash
|
# replace base url
|
||||||
|
if [ "${CRAWLAB_BASE_URL}" = "" ];
|
||||||
|
then
|
||||||
|
:
|
||||||
|
else
|
||||||
|
indexpath=/app/dist/index.html
|
||||||
|
sed -i "s?/js/?${CRAWLAB_BASE_URL}/js/?g" ${indexpath}
|
||||||
|
sed -i "s?/css/?${CRAWLAB_BASE_URL}/css/?g" ${indexpath}
|
||||||
|
|
||||||
|
sed -i "s/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"/ <link rel=\"icon\" type=\"image\/x-icon\" href=\"\/${CRAWLAB_BASE_URL}/g" ${indexpath}
|
||||||
|
sed -i "s/ <link rel=\"stylesheet\" href=\"/ <link rel=\"stylesheet\" href=\"${CRAWLAB_BASE_URL}\//g" ${indexpath}
|
||||||
|
sed -i "s/ window.VUE_APP_API_BASE_URL = '/ window.VUE_APP_API_BASE_URL = '\/${CRAWLAB_BASE_URL}/g" ${indexpath}
|
||||||
|
fi
|
||||||
|
|
||||||
# start nginx
|
# start nginx
|
||||||
service nginx start
|
service nginx start
|
||||||
@@ -18,3 +30,4 @@ weed server \
|
|||||||
-volume.port 9999 \
|
-volume.port 9999 \
|
||||||
-filer \
|
-filer \
|
||||||
>> /var/log/weed.log 2>&1 &
|
>> /var/log/weed.log 2>&1 &
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ services:
|
|||||||
image: crawlabteam/crawlab:latest
|
image: crawlabteam/crawlab:latest
|
||||||
container_name: crawlab_master
|
container_name: crawlab_master
|
||||||
environment:
|
environment:
|
||||||
|
CRAWLAB_BASE_URL: crawlab
|
||||||
CRAWLAB_SERVER_MASTER: Y
|
CRAWLAB_SERVER_MASTER: Y
|
||||||
CRAWLAB_MONGO_HOST: mongo
|
CRAWLAB_MONGO_HOST: mongo
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user