cleanup and generate mongod-start script
This commit is contained in:
parent
11828c2d2e
commit
276d034468
0
.gitignore
vendored
Executable file
0
.gitignore
vendored
Executable file
12
Dockerfile
12
Dockerfile
@ -55,14 +55,22 @@ ENV MONGO_LOG $HOME/.mongodb.log
|
|||||||
RUN mkdir $MONGO_DB
|
RUN mkdir $MONGO_DB
|
||||||
|
|
||||||
# launch mongo
|
# launch mongo
|
||||||
|
# this could be done as an entrypoint or whatever
|
||||||
# RUN mongod --dbpath $MONGO_DB --logpath $MONGO_LOG --fork --journal
|
# 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
|
# create a data volume
|
||||||
# ADD . /data
|
VOLUME /data
|
||||||
|
|
||||||
# expose the ports
|
# expose the ports
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
EXPOSE 35729
|
EXPOSE 35729
|
||||||
|
|
||||||
|
|
||||||
|
14
README.md
Normal file → Executable file
14
README.md
Normal file → Executable file
@ -1,2 +1,16 @@
|
|||||||
# docker-mean-dev
|
# docker-mean-dev
|
||||||
A docker container for developing mean stack applications
|
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
|
@ -1,3 +1,3 @@
|
|||||||
#!/bin/bash
|
#!/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
|
Loading…
Reference in New Issue
Block a user