Public Repository

Last pushed: 8 months ago
Short Description
A base image with centos 7, nginx, nodejs, mongodb
Full Description

Dockerfile

# joycoding/centos-nginx-nodejs-mongodb dockerfile
# centos, nginx, nodejs, mongodb
# @author Shaojiang Cai caishaojiang@gmail.com
# @date 31/03/2017

FROM centos

# install nginx
RUN yum update; yum clean all
RUN yum -y install epel-release; yum clean all
RUN yum -y install nginx; yum clean all
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log
RUN ln -sf /dev/stderr /var/log/nginx/error.log

# install nodejs
RUN curl --silent --location https://rpm.nodesource.com/setup_7.x | bash -
RUN yum -y install nodejs; yum clean all
RUN yum install gcc-c++ openssl-devel make; yum clean all
RUN npm install -g express-generator
RUN npm install -g webpack
RUN npm install -g gulp

# install mongodb
ADD ./mongodb-org-3.2.repo /etc/yum.repos.d/
RUN yum -y install mongodb-org-server mongodb-org-shell mongodb-org-tools && \
    yum clean all && \
    mkdir -p /var/lib/mongo && \
    chown -R mongod:mongod /var/lib/mongo

VOLUME ["/var/lib/mongo"]
EXPOSE 27017
CMD ["/usr/bin/mongod", "--dbpath", "/var/lib/mongo"]

Run

$ docker run -it -p 9000:27017 joycoding/centos-nginx-nodejs-mongodb

Docker Pull Command
Owner
joycoding