adding Dockerfile and puma

master
Thomas Riboulet 9 years ago
parent bb578a4073
commit 7afba8f7d3

@ -0,0 +1,2 @@
RACK_ENV=production
PORT=3000

@ -0,0 +1,25 @@
FROM ubuntu:14.04
# Install packages for building ruby
RUN apt-get install -y software-properties-common
RUN apt-add-repository -y ppa:brightbox/ruby-ng
RUN apt-get update
RUN apt-get install -y --force-yes build-essential curl wget git
RUN apt-get install -y --force-yes zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev ruby2.1
RUN apt-get clean
RUN gem install bundler foreman
RUN mkdir -p /var/app
# Set environment variables.
ENV HOME /var/app
ENV PORT 3000
ENV RACK_ENV production
# Define working directory.
WORKDIR /var/app
RUN git clone git@github.com:mcansky/sinatra_hello.git /var/app
RUN cd /var/app; bundle install
EXPOSE 3000
CMD ["/usr/local/bin/foreman","start","-d","/var/app"]

@ -3,3 +3,5 @@ gem 'sinatra'
gem 'unicorn'
gem 'capistrano', '2.15.5'
gem 'haml'
gem 'puma'

@ -18,6 +18,8 @@ GEM
net-ssh (2.8.0)
net-ssh-gateway (1.2.0)
net-ssh (>= 2.6.5)
puma (2.11.1)
rack (>= 1.1, < 2.0)
rack (1.5.2)
rack-protection (1.5.2)
rack
@ -38,5 +40,6 @@ PLATFORMS
DEPENDENCIES
capistrano (= 2.15.5)
haml
puma
sinatra
unicorn

@ -0,0 +1 @@
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}
Loading…
Cancel
Save