When deploying a Rails application (v5.2.4) created using Docker to a production environment, when I tried to precompile the assets, I got the following error and could not execute it.
$docker-compose run web bundle exec rake assets:precompile RAILS_ENV=production
Starting excite-map_db_1 ... done Yarn executable was not detected in the system. Download Yarn at https://yarnpkg.com/en/docs/instal
Add the following to the Dockerfile
RUN curl https://deb.nodesource.com/setup_12.x | bash RUN curl https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list RUN apt-get update && apt-get install -y nodejs yarn postgresql-client