From 2c37f87cbcc1e36ccc1e78d83bfeb9ae31744e71 Mon Sep 17 00:00:00 2001 From: shawn-higgins1 <23224097+shawn-higgins1@users.noreply.github.com> Date: Mon, 22 Jul 2019 14:31:11 -0400 Subject: [PATCH] Fix the dockerfile for the new version of rails (#658) * Fix the dockerfile for the new version of rails * Update Dockerfile --- Dockerfile | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 665cb8f2..604aa1b6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,14 @@ FROM ruby:2.5 # Install app dependencies. -RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs +RUN apt-get update -qq && apt-get install -y build-essential libpq-dev curl + +ADD https://dl.yarnpkg.com/debian/pubkey.gpg /tmp/yarn-pubkey.gpg + +RUN apt-key add /tmp/yarn-pubkey.gpg && rm /tmp/yarn-pubkey.gpg && \ +echo 'deb http://dl.yarnpkg.com/debian/ stable main' > /etc/apt/sources.list.d/yarn.list && \ +curl -sL https://deb.nodesource.com/setup_10.x | bash - && \ +apt-get update && apt-get install -y nodejs yarn # Set an environment variable for the install location. ENV RAILS_ROOT /usr/src/app @@ -23,9 +30,9 @@ RUN bundle install --without development test --deployment --clean # Adding project files. COPY . . -# Precompile assets. -RUN bundle exec rake assets:clean -RUN bundle exec rake assets:precompile +# Precompile assets +RUN SECRET_KEY_BASE="$(bundle exec rake secret)" bundle exec rake assets:clean +RUN SECRET_KEY_BASE="$(bundle exec rake secret)" bundle exec rake assets:precompile # Expose port 80. EXPOSE 80