-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
beb7184
commit 8e48f38
Showing
3 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.env | ||
.env.test | ||
.git | ||
.rubocop.yml | ||
.travis.yml | ||
log/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM ruby:2.0.0-p643 | ||
|
||
# Install deps | ||
RUN apt-get update \ | ||
&& apt-get install -y libreadline-dev nano vim \ | ||
&& apt-get purge -y --auto-remove | ||
|
||
# Ensure Gemfile.lock is up to date | ||
RUN bundle config --global frozen 1 | ||
|
||
# Install latest released Napa to get baseline dependencies | ||
RUN gem install napa | ||
|
||
# Add a simple Procfile parser | ||
ADD contrib/start.rb /start | ||
|
||
# Create directory for app | ||
RUN mkdir -p /usr/src/app | ||
WORKDIR /usr/src/app | ||
|
||
# Copy Gemfile and Gemfile.lock and run bundle install | ||
ONBUILD COPY Gemfile /usr/src/app/ | ||
ONBUILD COPY Gemfile.lock /usr/src/app/ | ||
ONBUILD RUN bundle install | ||
|
||
# Copy rest of app | ||
ONBUILD COPY . /usr/src/app | ||
|
||
CMD ["/start", "web"] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/usr/local/bin/ruby | ||
|
||
require 'yaml' | ||
|
||
# attempt to parse Procfile | ||
begin | ||
proc = YAML.load_file('Procfile') | ||
command = proc[ARGV[0]] | ||
|
||
if command | ||
exec(command) | ||
else | ||
puts "Could not find #{ARGV[0]} in Procfile" | ||
exit 1 | ||
end | ||
rescue | ||
puts 'Failed to parse Procfile' | ||
exit 2 | ||
end |