-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1216 from transitland/docker-production
Docker improvements
- Loading branch information
Showing
8 changed files
with
40 additions
and
16 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,2 @@ | ||
.git | ||
.dockerignore |
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 |
---|---|---|
@@ -1,9 +1,23 @@ | ||
FROM ruby:2.3.1 | ||
|
||
# Install essentials | ||
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev postgresql-client libgeos-dev | ||
|
||
# Setup /app | ||
RUN mkdir /app | ||
WORKDIR /app | ||
ADD . /app | ||
RUN gem install bundler -v 1.12.5 | ||
ADD Gemfile /app/Gemfile | ||
ADD Gemfile.lock /app/Gemfile.lock | ||
|
||
# Install bundler | ||
RUN gem install bundler -v 1.16.1 | ||
|
||
# Install gems | ||
COPY components /app/components | ||
COPY Gemfile /app/Gemfile | ||
COPY Gemfile.lock /app/Gemfile.lock | ||
RUN bundle install | ||
|
||
# Install application | ||
COPY . /app | ||
|
||
# Run | ||
CMD bundle exec puma -C config/puma.rb |
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
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
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
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
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
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,11 @@ | ||
#!/usr/bin/env puma | ||
port ENV.fetch("PORT") { 3000 } | ||
environment ENV.fetch("RAILS_ENV") { "development" } | ||
|
||
# Preload app | ||
preload_app! | ||
|
||
# Configure connections | ||
on_worker_boot do | ||
ActiveRecord::Base.establish_connection | ||
end |