cleanup and generate mongod-start script

This commit is contained in:
Adam Brown 2015-01-26 21:06:38 -05:00
parent 11828c2d2e
commit 276d034468
4 changed files with 25 additions and 3 deletions

0
.gitignore vendored Executable file
View File

View File

@ -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

14
README.md Normal file → Executable file
View File

@ -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

View File

@ -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
docker run -v ~/docker/data:/data -p=8000:8000 -p=9000:9000 -p=3000:3000 -p=35729:35729 -it adamarthurryan/mean-dev