Created
November 11, 2015 09:18
-
-
Save marshyon/7e07d0bc3e7bbdf8d949 to your computer and use it in GitHub Desktop.
Dockerising - MongoDB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:14.04 | |
MAINTAINER Jon Brookes | |
ENV REFRESHED_AT 2015-11-05 | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10 | |
RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list | |
RUN apt-get update | |
RUN apt-get install -y mongodb-org | |
RUN stop mongod | |
RUN echo manual | sudo tee /etc/init/mongod.override | |
# Mongo stores it's db in : /var/lib/mongodb | |
# and logs to : /var/log/mongodb/mongod.log | |
ENV REFRESHED_AT 2015-11-05 | |
EXPOSE 27017 | |
WORKDIR /srv/www/my_app | |
ENV REFRESHED_AT 2015-11-05-01 | |
CMD /usr/bin/mongod --config /etc/mongod.conf --bind_ip `/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ideally create a working directory for the Dockerfile
create local directories for log and database files
set up the running image