Skip to content

Instantly share code, notes, and snippets.

@hagix9
Created November 2, 2013 06:17
Show Gist options
  • Save hagix9/7276134 to your computer and use it in GitHub Desktop.
Save hagix9/7276134 to your computer and use it in GitHub Desktop.
Dockerfile2 redis mongodb npm
#choice container image
FROM centos
#add repository
RUN rpm -ivh http://ftp.riken.jp/Linux/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
#install package
RUN yum install -y passwd
RUN yum install -y openssh-server
RUN yum install -y openssh-clients
RUN yum install -y sudo
#RUN yum install -y vim
#RUN yum install -y telnet
#RUN yum install -y tcpdump
#RUN yum install -y ftp
RUN yum install -y httpd
RUN yum install -y npm
RUN yum install -y redis
RUN npm install -g express
RUN npm install -g supervisor
#install mongodb
RUN yum install -y wget
RUN wget -P /etc/yum.repos.d https://gist.github.com/reggi/4956419/raw/47f0b07f2220ac126aabd0a110f3a2b7b43529a3/10gen.repo
RUN yum --enablerepo=10gen install mongo-10gen mongo-10gen-server -y
#root password change
#RUN bash -c 'echo "root:root" | chpasswd'
#useradd settings
RUN useradd stack
RUN echo "stack" | passwd --stdin stack
RUN su - stack -c 'ssh-keygen -N "" -t rsa -f /home/stack/.ssh/id_rsa'
RUN cp -a /etc/skel/.bash_profile /root
RUN cp -a /etc/skel/.bashrc /root
RUN mv /.npm /root
#sudo settings
RUN echo "stack ALL=(ALL) ALL" >> /etc/sudoers.d/stack
#sshd settings
RUN sed -i.bak 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
#httpd settings
RUN chkconfig httpd on
#mongodb settings
RUN chkconfig mongod on
#redis settings
RUN chkconfig redis on
#portforward settings
#EXPOSE 10022:22
#EXPOSE 10080:80
EXPOSE 22
EXPOSE 80
#init
CMD ["init"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment