Public Repository

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


# joycoding/centos-nginx-nodejs-mongodb dockerfile
# centos, nginx, nodejs, mongodb
# @author Shaojiang Cai
# @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 | 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"]


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

Docker Pull Command

Comments (0)