File: compose/rails.md
Since the versions of ruby, rails and postgres have all been updated since this document was created, maybe this document should be updated?
change
FROM ruby:2.5
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
to
FROM ruby:2.7.1
RUN curl -sS 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 -qq && apt-get install -y nodejs postgresql-client yarn
the new Rails version uses webpacker for hot-reloading, webpacker requires yarn to be installed, use latest version of Ruby
change
gem 'rails', '~>5'
to
gem 'rails', '~> 6.0.3', '>= 6.0.3.3'
the latest Rails version is 6+
in db service under volumes: change
- ./tmp/db:/var/lib/postgresql/data
to
- postgres:/var/lib/postgresql/data
add volumes: section at root level of file
volumes:
postgres:
web service add a links: section links:
- db
1 & 2 - the newer postgres when running in docker has problems with file system due to permissions problems
3 - container doesn't know where to look for the database
Thanks @rcaf-anthony for all the suggestions. We'll update the page.
Hi! I was just trying to use the tutorial and was unable to complete it because of the yarn dependency. I was able to find information from a couple of places to resolve it but thought I would add a gentle reminder to please update it soon. Thank you!
Most helpful comment
Hi! I was just trying to use the tutorial and was unable to complete it because of the yarn dependency. I was able to find information from a couple of places to resolve it but thought I would add a gentle reminder to please update it soon. Thank you!