diff --git a/.gitignore b/.gitignore index 3251f27..ac335ff 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ client/bower_components dist server/config/local.env.js wdiff-1.2.2 +data diff --git a/docker/README.md b/docker/README.md index a7a8003..8ace789 100755 --- a/docker/README.md +++ b/docker/README.md @@ -1,15 +1,14 @@ -# wdiff-markdown/docker +# wdiff-markdown/docker A docker container for deploying the wdiff-markdown application Usage ====== -Build the container with `docker build -t 'adamarthurryan/wdiff-markdown'`. +Build the container with `docker build -t 'adamarthurryan/wdiff-markdown'`. Run the script `prepare.sh` from this folder. -To launch the application in development mode, run `launch-devel.sh`. - -To launch the application in production mode, run `launch-prod.sh`. +To launch the application in development mode, run `../launch-devel.sh`. +To launch the application in production mode, run `../launch-prod.sh`. diff --git a/docker/start-mongodb b/docker/start-mongodb deleted file mode 100755 index e45cb7e..0000000 --- a/docker/start-mongodb +++ /dev/null @@ -1,37 +0,0 @@ -#! /bin/bash - -# Start a data container and a mongodb instance - -echo - -# test if the data-db container has been created -if docker inspect -f {{.Name}} data-db - then - echo "* data-db exists" - else - echo "* creating data-db" - # The data container has a volume at /data/db, is named 'data' and is based on mongo - docker create -v /data/db --name data-db mongo echo "Data container - database" -fi - -echo - -# test if the mongo db server has been created -if docker inspect -f {{.Name}} mongodb - then - # make sure the server is running - if docker inspect -f {{.State.Running}} mongodb - then - echo "* mongodb exists and is running" - else - echo "* starting mongodb" - docker start mongodb - fi - else - echo "* creating new mongodb server" - # Start a mongo db server as a daemon - # The server will use the data-db container as a volume - docker run -p 27017 --name=mongodb --volumes-from=data-db -d mongo -fi - - diff --git a/launch-devel.sh b/launch-devel.sh index 0da31c4..f02ad4d 100755 --- a/launch-devel.sh +++ b/launch-devel.sh @@ -6,16 +6,14 @@ # test if the data-docker-home container has been created if docker inspect -f {{.Name}} data-docker-home > /dev/null - then + then echo > /dev/null else echo "* creating data-docker-home container" echo # The data container has a volume at /home/docker, is named 'data' and is based on busybox docker create -v /home/docker --name data-docker-home adamarthurryan/mean echo "Data container - docker home" - + fi -docker/start-mongodb - -docker run -it --rm --link mongodb:mongodb --volumes-from=data-docker-home -v ${PWD}:/working -w /working -p 9000:9000 -p 35729:35729 adamarthurryan/mean grunt serve +docker run -it --rm --volumes-from=data-docker-home -v ${PWD}:/working -w /working -p 9000:9000 -p 35729:35729 adamarthurryan/mean grunt serve diff --git a/launch-production.sh b/launch-production.sh index e623cb6..2c262dd 100755 --- a/launch-production.sh +++ b/launch-production.sh @@ -6,16 +6,14 @@ # test if the data-docker-home container has been created if docker inspect -f {{.Name}} data-docker-home > /dev/null - then + then echo > /dev/null else echo "* creating data-docker-home container" echo # The data container has a volume at /home/docker, is named 'data' and is based on busybox docker create -v /home/docker --name data-docker-home adamarthurryan/mean echo "Data container - docker home" - + fi -docker/mongodb-start - -docker run -it --rm --link mongodb:mongodb -e "PORT=8080" --volumes-from=data-docker-home -v ${PWD}:/working -w /working -p 80:8080 adamarthurryan/mean grunt serve:dist +docker run -it --rm -e "PORT=8080" --volumes-from=data-docker-home -v ${PWD}:/working -w /working -p 80:8080 adamarthurryan/mean grunt serve:dist