Skip to content

Instantly share code, notes, and snippets.

@k5trismegistus
Created December 9, 2014 00:25
Show Gist options
  • Save k5trismegistus/2e324ac28c09f01979ec to your computer and use it in GitHub Desktop.
Save k5trismegistus/2e324ac28c09f01979ec to your computer and use it in GitHub Desktop.
FROM ubuntu:14.04
MAINTAINER keigo yamamoto
# Set env var
ENV DEBIAN_FRONTEND noninteractive
# Update repositories & upgread packages
RUN sed -i 's/# \(.*multiverse$\)/\1/g' /etc/apt/sources.list
RUN apt-get update && apt-get -y upgrade
# Install basic package
RUN apt-get install -y build-essential software-properties-common git
RUN apt-get install -y curl htop man unzip wget screen vim nano
RUN apt-get install -y
RUN apt-get install -y zlib1g-dev libssl-dev libreadline-dev libyaml-dev
RUN apt-get install -y libxml2-dev libxslt1-dev libcurl4-openssl-dev
RUN apt-get install -y autoconf bison libreadline6-dev libncurses5-dev
RUN apt-get install -y imagemagick sqlite3 openssh-client supervisor
# Add repositories
RUN add-apt-repository -y ppa:webupd8team/java
RUN add-apt-repository -y ppa:nginx/stable
RUN wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
RUN echo "deb http://packages.elasticsearch.org/elasticsearch/1.2/debian stable main" >> /etc/apt/sources.list.d/elasticsearch.list
RUN apt-get update
# Install ruby
RUN git clone https://github.com/sstephenson/rbenv.git /root/.rbenv
RUN git clone https://github.com/sstephenson/ruby-build.git /root/.rbenv/plugins/ruby-build
RUN ./root/.rbenv/plugins/ruby-build/install.sh
ENV PATH /root/.rbenv/bin:$PATH
RUN echo 'eval "$(rbenv init -)"' >> .bashrc
RUN curl -fsSL https://gist.github.com/EdVanDance/9738787.txt | rbenv install --patch 2.0.0-p451
RUN rbenv global 2.0.0-p451
RUN rbenv rehash
RUN rbenv exec gem install bundler
### above OK
# Install java
RUN echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
RUN echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
RUN apt-get install -y oracle-java7-installer
# Install elasticsearch
RUN apt-get install -y elasticsearch
# Install and setup redis
RUN apt-get install -y redis-server
RUN mkdir -p /etc/redis
RUN mkdir -p /opt/redis/data
RUN chown redis:redis /opt/redis
RUN chown redis:redis /opt/redis/data
RUN mkdir -p /opt/redis/log
RUN chown redis:redis /opt/redis/log
ADD ./scripts/redis.sh /opt/redis/redis.sh
ADD ./conf/redis.conf /etc/redis/
ADD ./conf/sentinel.conf /etc/redis/
# Install and setup supervisor
RUN apt-get install -y supervisor
ADD ./conf/supervisord.conf /etc/supervisor/conf.d/redis.conf
# Set memory system condition
#RUN sysctl vm.overcommit_memory=1
EXPOSE 22 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment