Skip to content
Snippets Groups Projects
Commit ebea56ff authored by Eike Cochu's avatar Eike Cochu
Browse files

updated docker scripts, accept configuration

parent 2e455499
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
#######################################################################################
# CONFIGURATION
BUILD_WITH_BACKEND=1
BUILD_WITH_FRONTEND=1
#######################################################################################
DIR="$(dirname "$(readlink -f "$0")")"
if [ $BUILD_WITH_BACKEND -ne 1 ]; then
find webapps -maxdepth 1 -not -name ".*" -not -path webapps -exec rm -rf {} \;
fi
if [ $BUILD_WITH_FRONTEND -ne 1 ]; then
find webroot -maxdepth 1 -not -name ".*" -not -path webroot -exec rm -rf {} \;
fi
docker build -t eikecochu/vipra . docker build -t eikecochu/vipra .
exit 0 exit 0
\ No newline at end of file
#!/bin/sh #!/bin/sh
#######################################################################################
# CONFIGURATION
# set host machine ports
HOST_NGINX=80 HOST_NGINX=80
HOST_TOMCAT=8080 HOST_TOMCAT=8080
HOST_ELASTICSEARCH_REST=9200 HOST_ELASTICSEARCH_REST=9200
HOST_ELASTICSEARCH_API=9300 HOST_ELASTICSEARCH_API=9300
HOST_MONGODB=27017 HOST_MONGODB=27017
# set to 1 to override built in webapps and webroot
REPLACE_WEBAPPS=1
REPLACE_WEBROOT=1
#######################################################################################
DIR="$(dirname "$(readlink -f "$0")")" DIR="$(dirname "$(readlink -f "$0")")"
PORT_MAPPING="-p $HOST_NGINX:80 -p $HOST_TOMCAT:8080 -p $HOST_ELASTICSEARCH_REST:9200 -p $HOST_ELASTICSEARCH_API:9300 -p $HOST_MONGODB:27017"
if [ $REPLACE_WEBAPPS -eq 1 ]; then
VOLUME_WEBAPPS="-v $DIR/webapps:/tomcat/webapps"
fi
if [ $REPLACE_WEBROOT -eq 1 ]; then
VOLUME_WEBROOT="-v $DIR/webroot:/webroot"
fi
docker run -d -p $HOST_NGINX:80 -p $HOST_TOMCAT:8080 -p $HOST_ELASTICSEARCH_REST:9200 -p $HOST_ELASTICSEARCH_API:9300 -p $HOST_MONGODB:27017 -v $DIR/webroot:/webroot -v $DIR/webapps:/tomcat/webapps eikecochu/vipra docker run -d $PORT_MAPPING $VOLUME_WEBAPPS $VOLUME_WEBROOT eikecochu/vipra
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment