Last active
August 14, 2017 20:33
-
-
Save stpettersens/8701b1b8124d7427b683 to your computer and use it in GitHub Desktop.
Dockerfile for container that provides MongoDB + Node.js.
This file contains hidden or 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
# | |
# Dockerfile for a container that provides Node.js and MongoDB. | |
# saintpettersens/nodemongodb | |
# | |
# Use Ubuntu as base for container. | |
FROM ubuntu | |
# Install MongoDB. | |
ENV mongorepo "http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.2 multiverse" | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 | |
RUN echo "deb $mongorepo" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list | |
RUN apt-get update && apt-get install -y mongodb-org | |
# Install Node.js. | |
RUN apt-get install -y nodejs | |
# Install npm. | |
RUN apt-get install -y npm | |
# Make symbolic link to Node.js ("node"). | |
RUN ln -s /usr/bin/nodejs /usr/bin/node | |
# Print MongoDB, Node.js and npm versions. | |
CMD mongo --version && echo "Node.js $(node --version)" && echo "npm $(npm --version)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi I think you need to add lines below before mongodb installation
RUN apt-get autoremove
RUN apt-get -f install
RUN touch /etc/init.d/mongod
otherwise it gets exception