From 276d0344682eb9373033be9b8fd24f09e56e13a8 Mon Sep 17 00:00:00 2001 From: Adam Brown Date: Mon, 26 Jan 2015 21:06:38 -0500 Subject: [PATCH] cleanup and generate mongod-start script --- .gitignore | 0 Dockerfile | 12 ++++++++++-- README.md | 14 ++++++++++++++ docker-run | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) create mode 100755 .gitignore mode change 100644 => 100755 README.md diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..e69de29 diff --git a/Dockerfile b/Dockerfile index d19d5bc..7299849 100755 --- a/Dockerfile +++ b/Dockerfile @@ -55,14 +55,22 @@ ENV MONGO_LOG $HOME/.mongodb.log RUN mkdir $MONGO_DB # launch mongo +# this could be done as an entrypoint or whatever # RUN mongod --dbpath $MONGO_DB --logpath $MONGO_LOG --fork --journal +# create a script for launching mongo +RUN mkdir $HOME/bin +RUN echo 'mongod --dbpath $MONGO_DB --logpath $MONGO_LOG --fork --journal' > $HOME/bin/mongod-start +RUN chmod +x $HOME/bin/mongod-start +ENV PATH $PATH:$HOME/bin -# add a volume from the current folder -# ADD . /data +# create a data volume +VOLUME /data # expose the ports EXPOSE 8000 EXPOSE 9000 EXPOSE 3000 EXPOSE 35729 + + diff --git a/README.md b/README.md old mode 100644 new mode 100755 index e65788a..33756aa --- a/README.md +++ b/README.md @@ -1,2 +1,16 @@ # docker-mean-dev A docker container for developing mean stack applications + +Useage +###### + +Build the container with + sudo docker build -t 'tag name' . + +and run with + sudo ./docker-run + +The run script will attempt to mount a data volume from the host os from ~/docker/data. + +Finally, from the docker container, launch mongod with + mongod-start \ No newline at end of file diff --git a/docker-run b/docker-run index af91733..d68afd3 100755 --- a/docker-run +++ b/docker-run @@ -1,3 +1,3 @@ #!/bin/bash -docker run -v ~/docker/data -p=8000:8000 -p=9000:9000 -p=3000:3000 -p=35729:35729 -it adamarthurryan/mean-dev \ No newline at end of file +docker run -v ~/docker/data:/data -p=8000:8000 -p=9000:9000 -p=3000:3000 -p=35729:35729 -it adamarthurryan/mean-dev \ No newline at end of file