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 3 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
28 changes: 28 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,34 @@ 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.1 sh -c "bundle install --without production && bundle exec rake serve"
alaxalves marked this conversation as resolved.
Show resolved Hide resolved
```

to generate the website and start a local web server


Open [http://localhost:9292/](http://localhost:9292/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use <http://localhost:9292/> instead of [http://localhost:9292/](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.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can be updated? It seems that 2.6.4 is available: https://hub.docker.com/_/ruby. Currently .travis.yml specified the version to 2.6.3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@yous do I use the same version as travis or do I update Travis to use 2.6.4 as well?

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