From a880f6541e407a08201677370cab449034571a60 Mon Sep 17 00:00:00 2001 From: oldjamey Date: Tue, 4 Sep 2018 15:01:23 -0700 Subject: [PATCH 1/2] Fix Docker restart issue added line in docker/entrypoint that enables clean restarting of the application without causing a boot loop --- docker/entrypoint | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/entrypoint b/docker/entrypoint index 6b6ba9355..d067f7e44 100755 --- a/docker/entrypoint +++ b/docker/entrypoint @@ -7,6 +7,7 @@ CMD=$1 case "$CMD" in 'start' ) echo `pwd` + rm -f /app/tmp/pids/server.pid bundle exec rails s -b 0.0.0.0 ;; From a010c3e503bd00c592eca1bedfcb415802d0491b Mon Sep 17 00:00:00 2001 From: oldjamey Date: Wed, 5 Sep 2018 09:44:58 -0500 Subject: [PATCH 2/2] Update Dockerfile for optional production use Added commented-out portions of Dockerfile that can be uncommented for use in production. Additional instruction was supplied in Dockerfile comments to change parameter in config/environments/production.rb for standard Docker best practices production configuration. --- Dockerfile | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Dockerfile b/Dockerfile index aa5e25e16..dd44aaebd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,6 +18,22 @@ WORKDIR /app/ COPY . /app/ +### +# FOR PRODUCTION USE: +# +# If you need the app to continue listening on HTTP instead of HTTPS +# (like terminating SSL on upstream server, i.e. Nginx proxy_pass to HTTP), +# you will need to set 'config.force_ssl = false' in 'config/environments/production.rb'. +# +# Uncomment SECRET_KEY_BASE, RAILS_ENV, and [optionally] RAILS_SERVE_STATIC_FILES for production: +# ENV SECRET_KEY_BASE=[VALUE OF `bundle exec rake secret`] +# +# ENV RAILS_ENV=production +# +# ENV RAILS_SERVE_STATIC_FILES=true +# Leave RAILS_SERVE_STATIC_FILES commented if Nginx/Apache will serve static files instead of rails. +### + RUN bundle install RUN npm install @@ -28,6 +44,9 @@ RUN bundle exec rake bower:install RUN npm run build +# Uncomment the line below for production: +# RUN bundle exec rake assets:precompile + EXPOSE 3000 ENTRYPOINT [ "./docker/entrypoint" ]