diff --git a/README.md b/README.md index 0f2a8f26de..7f539b3ad9 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,33 @@ in your browser to access the preview. **Note:** The build of the site will take several minutes. +### Preview with Docker + +Run the following + +``` sh +docker run -it --name ruby-lang -v $PWD:/www.ruby-lang.org -w /www.ruby-lang.org --network host ruby:2.6.3 sh -c "bundle install --without production && bundle exec rake serve" +``` + +to generate the website and start a local web server + + +Open in your browser to access the preview. + +### Preview with Docker Compose + +Run the following + +``` sh +docker-compose up +``` + +to generate the website and start a local web server + + +Open [http://localhost:9292/](http://localhost:9292/) +in your browser to access the preview. + ### Preview on Heroku In case a build is not possible on your local machine diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000000..0498232b1c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: '3.5' +services: + web: + container_name: ruby-lang + image: ruby:2.6.3 + command: > + sh -c "bundle check || bundle install --without production && + bundle exec rake build && + bundle exec rake serve" + volumes: + - .:/www.ruby-lang.org + - bundle_cache:/usr/local/bundle + working_dir: /www.ruby-lang.org + ports: + - 9292:9292 + network_mode: host + +volumes: + bundle_cache: + name: ruby-lang-bundle