Last active
August 23, 2017 01:04
-
-
Save Bevilacqua/5754480c2af1e1d222b93c82402533f7 to your computer and use it in GitHub Desktop.
This file contains 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
# Use Ubuntu as os | |
FROM ubuntu:16.04 | |
# Passed Environment variables | |
ARG GIT_USERNAME | |
ARG GIT_TOKEN | |
# Packages & Environment Variables | |
ENV SRP_ROOT /Serpico | |
ENV GEM /usr/local/rvm/rubies/ruby-2.1.5/bin/gem | |
ENV BUILD_PACKAGES bash sudo curl vim git gawk g++ gcc make libc6-dev libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgmp-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev | |
ENV GIT_USERNAME $GIT_USERNAME | |
ENV GIT_TOKEN $GIT_TOKEN | |
# Install Packages | |
RUN apt-get update && \ | |
apt-get install -y $BUILD_PACKAGES | |
RUN rm /bin/sh && ln -s /bin/bash /bin/sh | |
# Pull Down From Remote | |
RUN git clone https://$GIT_USERNAME:$GIT_TOKEN@github.com/HackLabs/Serpico.git | |
WORKDIR $SRP_ROOT | |
# Install Ruby | |
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 | |
RUN curl -L https://get.rvm.io | bash -s stable | |
RUN /bin/bash -l -c "echo 'gem: --no-ri --no-rdoc' > ~/.gemrc" | |
RUN /bin/bash -l -c rvm requirements | |
RUN /bin/bash --login -c "source /usr/local/rvm/scripts/rvm" | |
ENV PATH /usr/local/rvm/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
RUN rvm install 2.1.5 && rvm use 2.1.5 | |
RUN rvm all do gem install bundler | |
# Install Required Gems | |
RUN /bin/bash --login -c "bundle update msfrpc-client" | |
RUN /bin/bash --login -c "bundle install" | |
# Expose TCP:443 | |
EXPOSE 443 | |
EXPOSE 80 | |
# Start server | |
ENTRYPOINT /bin/bash -lc "sh deploy.sh $GIT_USERNAME $GIT_TOKEN" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment