Skip to content

Instantly share code, notes, and snippets.

@mansurali901
Created January 1, 2017 20:36
Show Gist options
  • Save mansurali901/6da33d02deea11abe380cabd66790dc9 to your computer and use it in GitHub Desktop.
Save mansurali901/6da33d02deea11abe380cabd66790dc9 to your computer and use it in GitHub Desktop.
IONA Crawling Service Setup
FROM ubuntu:16.04
MAINTAINER Mansur Ul Hasan <[email protected]>
RUN apt-get update -y
RUN apt-get install openssh-server -y
RUN mkdir /var/run/sshd
RUN echo 'root:Crawling!@#' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
################## Setting up JAVA ##################
##RUN echo "Downloading JAVA JDK 1.8 from Local repository......"
RUN wget https://www.dropbox.com/s/dwsqw6gofynaf5e/jdk1.8.0_91.tar?dl=0
RUN mv jdk1.8.0_91.tar?dl=0 jdk1.8.0_91.tar
##RUN echo "Installing JAVA JDK 1.8"
RUN mkdir -p /usr/java
RUN mv jdk1.8.0_91.tar /usr/java/
#RUN cd /usr/java/
RUN tar xvf /usr/java/jdk1.8.0_91.tar -C /usr/java/
RUN ln -s /usr/java/jdk1.8.0_91 /usr/java/latest
##echo "Creating Links of binaries"
RUN ln -s /usr/java/latest/bin/java /usr/bin/java
RUN ln -s /usr/java/latest/bin/javac /usr/bin/javac
RUN ln -s /usr/java/latest/bin/javah /usr/bin/javah
RUN ln -s /usr/java/latest/bin/javap /usr/bin/javap
RUN ln -s /usr/java/latest/bin/javadoc /usr/bin/javadoc
RUN ln -s /usr/java/latest/bin/javaws /usr/bin/javaws
#echo "Checking JAVA Version"
#RUN java -version
## Installing PhantomJS
RUN wget https://www.dropbox.com/s/9uycgtucnl05e4t/phantomjs-2.1.1-linux-x86_64.tar.gz?dl=0
RUN mv -v phantomjs-2.1.1-linux-x86_64.tar.gz?dl=0 phantomjs-2.1.1-linux-x86_64.tar.gz
RUN tar -xvf phantomjs-2.1.1-linux-x86_64.tar.gz -C /usr/
RUN ln -s /usr/phantomjs-2.1.1-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
## PhantomJS Secret dependencies for CasperJS
RUN apt-get install libfontconfig -y
## Installing NodeJS
RUN apt-get install nodejs -y
## Installing NPM
RUN apt-get install npm -y
RUN apt-get install pkg-config make g++ -y
#RUN add-apt-repository ppa:chris-lea/node.js -y
#RUN apt-get update -y
#RUN apt-get install nodejs -y
## Installing Grunt CLI
RUN npm install -g grunt-cli
RUN npm install -g [email protected]
################## Java Setup Completed ##################
# echo "Installing Mongo Repository"
#RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
RUN wget https://www.dropbox.com/s/dvhcoc0efqoj0zm/mongodb-org-3.0.list.txt?dl=0
RUN mv mongodb-org-3.0.list.txt?dl=0 mongodb-org-3.0.list
RUN mv mongodb-org-3.0.list /etc/apt/sources.list.d/
# echo "Updating Repository"
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN apt-get update
##echo "Installing Mongo Server "
RUN apt-get install -y mongodb-org
RUN wget https://www.dropbox.com/s/8mbnfw6s2ou1bqo/mongod.txt?dl=0
RUN mv mongod.txt?dl=0 mongod
RUN chmod +x mongod
RUN mv mongod /etc/init.d/
RUN export LC_ALL=C
RUN mongod --fork --dbpath /var/lib/mongodb/ --smallfiles --logpath /var/log/mongodb.log --logappend &
EXPOSE 22
EXPOSE 27017
CMD ["/usr/sbin/sshd", "-D"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment