Skip to content

Commit

Permalink
Merge pull request #2327 from alphagov/dockerfile-tlc
Browse files Browse the repository at this point in the history
Update Dockerfile to reflect it should only run in RAILS_ENV=production
  • Loading branch information
kevindew authored Nov 12, 2020
2 parents 992c46e + 45a3115 commit 3732d0d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ FROM ruby:2.7.2
RUN apt-get update -qq && apt-get upgrade -y && apt-get install -y build-essential nodejs && apt-get clean
RUN gem install foreman

# This image is only intended to be able to run this app in a production RAILS_ENV
ENV RAILS_ENV production

ENV GOVUK_APP_NAME static
ENV RAILS_ENV development
ENV REDIS_URL redis://redis
ENV PORT 3013

Expand All @@ -13,10 +15,12 @@ RUN mkdir $APP_HOME
WORKDIR $APP_HOME
ADD .ruby-version $APP_HOME/
ADD Gemfile* $APP_HOME/
RUN bundle install
RUN bundle config set deployment 'true'
RUN bundle config set without 'development test'
RUN bundle install --jobs 4

ADD . $APP_HOME

RUN GOVUK_WEBSITE_ROOT=https://www.gov.uk GOVUK_APP_DOMAIN=www.gov.uk RAILS_ENV=production bundle exec rails assets:precompile
RUN GOVUK_WEBSITE_ROOT=https://www.gov.uk GOVUK_APP_DOMAIN=www.gov.uk bundle exec rails assets:precompile

CMD foreman run web

0 comments on commit 3732d0d

Please sign in to comment.