Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting sample config for container development #1992

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://localhost:9292/> 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
Expand Down
20 changes: 20 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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