Skip to content

Instantly share code, notes, and snippets.

@ijonas
Last active December 24, 2015 18:39
Show Gist options
  • Save ijonas/6844358 to your computer and use it in GitHub Desktop.
Save ijonas/6844358 to your computer and use it in GitHub Desktop.
Basic MongoDB config file and Dockerfile used by caseblocks/mongodb MongoDB container.
# MongoDB
#
# VERSION 0.0.1
#
# requires mongodb.conf @ https://gist.github.com/ijonas/6844358
FROM ubuntu
MAINTAINER [email protected]
# make sure the package repository is up to date
RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list
RUN apt-get update
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
RUN apt-get update -y
RUN apt-get install mongodb-10gen=2.4.6
EXPOSE 27017
ENTRYPOINT ["mongod", "-f", "/data/mongodb.conf"]
# mongodb.conf
dbpath=/data
logpath=/data/mongodb.log
logappend=true
replSet = cbrep
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment