Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Dockerfile.example → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM jaicob/rails-nginx-unicorn:onbuild
MAINTAINER jaicob(jaicob@icloud.com)
FROM pendragondev/rails-docker
MAINTAINER jordan(jordan@getvitaminc.com)

# Switch to the location the app is run out of
WORKDIR /home/rails/my-app
WORKDIR /home/rails/my-app

# Place custom unicorn configs here
ADD config/unicorn.rb /etc/my-app/config/unicorn.rb
# ADD config/unicorn.rb /etc/my-app/config/unicorn.rb
# ADD unicorn_init.sh /etc/init.d/unicorn

# Place custom nginx configs here
Expand All @@ -17,7 +17,7 @@ ADD config/unicorn.rb /etc/my-app/config/unicorn.rb

# Run setup script. This sets up the tmp folder and symlinks it to shared
# as well as sets up the database if necessary
RUN /etc/my-app/setup.sh
# RUN /etc/my-app/setup.sh

# Expose port 80
EXPOSE 80
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Docker-compose is useful for the development of your application. This automatically spins up
# a container based off the Dockerfile in the working dir and links it to a postgres instance.
# a container based off the Dockerfile in the working dir and links it to a postgres instance.
# Modify as necessary to suit your needs

web:
Expand Down Expand Up @@ -30,4 +30,4 @@ db:
# rails s | docker-compose run web rails s
# rspec spec/path/to/spec.rb | docker-compose run web rspec spec/path/to/spec.rb
# RAILS_ENV=test rake db:create | docker-compose run -e RAILS_ENV=test web rake db:create
# tail -f log/development.log | docker-compose run web tail -f log/development.log
# tail -f log/development.log | docker-compose run web tail -f log/development.log
21 changes: 10 additions & 11 deletions rails-nginx-unicorn/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM jaicob/rails:base
MAINTAINER jaicob(jaicob@icloud.com)
FROM pendragondev/rails
MAINTAINER jordan(jordan@getvitaminc.com)

# Install basics and postgres
RUN \
Expand All @@ -8,7 +8,7 @@ RUN \
sudo apt-get install -y libpq-dev

# Install supervisor
RUN sudo apt-get install -y supervisor
RUN sudo apt-get install -y supervisor

# Configure supervisor
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
Expand All @@ -31,14 +31,13 @@ RUN sudo apt-get install -y libxml2-dev libxslt1-dev
RUN mkdir /home/rails/my-app
WORKDIR /home/rails/my-app
ONBUILD COPY . /home/rails/my-app
ONBUILD RUN sudo chown -R rails /home/rails/my-app
ONBUILD RUN sudo chown -R rails /home/rails/my-app

# Install gems with binstubs
ONBUILD RUN \
bundle install && \
bundle binstubs unicorn && \
rbenv rehash && \
RAILS_ENV=production bundle exec rake assets:precompile --trace
# Install gems with binstubs
#ONBUILD RUN \
# rbenv install 2.2.2 && \
# rbenv global 2.2.2 && \
# gem install rails

# Configure unicorn
COPY unicorn.rb /etc/my-app/unicorn.rb
Expand All @@ -48,7 +47,7 @@ COPY unicorn_init.sh /etc/init.d/unicorn
COPY setup.sh /etc/my-app/setup.sh

# Set environment variables
ENV RAILS_ENV production
ENV RAILS_ENV development

# Expose port 80
EXPOSE 80
Expand Down
20 changes: 10 additions & 10 deletions rails/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Pull base image.
FROM ubuntu:14.04
MAINTAINER jaicob(jaicob@icloud.com)
MAINTAINER jordan(jordan@getvitaminc.com)

# Install basics.
RUN \
Expand All @@ -11,7 +11,7 @@ RUN \
apt-get install -y software-properties-common && \
apt-get install -y byobu curl git htop man unzip vim wget && \
apt-get install -y libffi-dev && \
rm -rf /var/lib/apt/lists/*
rm -rf /var/lib/apt/lists/*

# Install some dependencies
RUN apt-get update
Expand All @@ -26,7 +26,7 @@ RUN \
# Swich to user, Rails
USER rails

# Install rbenv as rails
# Install rbenv as rails
RUN \
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv && \
echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' | tee -a ~/.bashrc ~/.profile && \
Expand All @@ -37,7 +37,7 @@ RUN \
RUN \
mkdir ~/.rbenv/plugins && \
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build && \
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' | tee -a ~/.bashrc ~/.profile
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' | tee -a ~/.bashrc ~/.profile

# Do not copy gem package documentation
RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
Expand All @@ -46,12 +46,12 @@ RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
RUN . ~/.bashrc

# Set Env path for Rbenv
ENV RBENV_ROOT /home/rails/.rbenv
ENV RBENV_ROOT /home/rails/.rbenv
ENV PATH $RBENV_ROOT/bin:$RBENV_ROOT/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:$HOME/.rbenv/bin:/usr/bin:/bin:$PATH

# Install ruby
RUN rbenv install 2.2.0
RUN rbenv global 2.2.0
RUN rbenv install 2.2.2
RUN rbenv global 2.2.2

# Install bundler
RUN gem install bundler
Expand All @@ -62,8 +62,8 @@ RUN \
sudo apt-get install -y software-properties-common && \
sudo add-apt-repository ppa:chris-lea/node.js && \
sudo apt-get update && \
sudo apt-get install -y nodejs
sudo apt-get install -y nodejs

# Install Rails
RUN gem install rails --version=4.2.1
RUN gem install rails --version=4.2.2
RUN rbenv rehash