- Create the repo and clone it
- Create a dockerfile
- Create a docker-compose file
- Use docker-comose run web bash
- Inside, run
gem install rails && cd /app && rails new .
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs
RUN mkdir /myapp
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
COPY . /myapp
Update Gemfile
...
#replace sqlite3 with
gem 'pg', '~> 0.18'
#Need authentication? Devise is good...
gem 'devise'
gem 'devise-bootstrap-views'
Update database.yml
(See below)
run rails generate bootstrap:install
to get the bootstrap generators. Might have to --force
if you've already got some.
Handy commands
docker-compose build
docker-compose up
docker-compose down
docker compose run web bash