Skip to content

Commit

Permalink
Use foreman to run application in docker environment
Browse files Browse the repository at this point in the history
Foreman is installed via a gem rather than bundle install due to the
somewhat contentious instructions on the foreman readme - this also has
the advantage of isolating this from the app.
  • Loading branch information
kevindew committed Feb 15, 2018
1 parent 194ee7b commit 2d1fa4b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM ruby:2.4.2
RUN apt-get update -qq && apt-get upgrade -y && apt-get install -y build-essential nodejs && apt-get clean
RUN gem install foreman

ENV DATABASE_URL mysql2://root:root@mysql/collections_publisher_development
ENV GOVUK_APP_NAME collections-publisher
Expand All @@ -19,4 +20,4 @@ RUN GOVUK_APP_DOMAIN=www.gov.uk RAILS_ENV=production bundle exec rails assets:pr

HEALTHCHECK CMD curl --silent --fail localhost:$PORT || exit 1

CMD bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p $PORT -b '0.0.0.0'"
CMD foreman run web
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
web: bundle exec unicorn -c ./config/unicorn.rb -p ${PORT:-3078}
worker: bundle exec sidekiq -C ./config/sidekiq.yml

0 comments on commit 2d1fa4b

Please sign in to comment.