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

Containerize process for local development setup #8220

Merged
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Gemfile.lock
*.iml
.jekyll-cache
.project
vendor/bundle
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ Follow these steps to set up your local copy of the repository:

1. Navigate to your cloned repository.

##### Building using locally installed packages

1. Install [Ruby](https://www.ruby-lang.org/en/) if you don't already have it. We recommend [RVM](https://rvm.io/), but you can use any method you prefer:

```
Expand All @@ -98,6 +100,14 @@ Follow these steps to set up your local copy of the repository:
bundle install
```

##### Building using containerization

Assuming you have `docker-compose` installed, run the following command:

```
docker compose -f docker-compose.dev.yml up
```

#### Troubleshooting

Try the following troubleshooting steps if you encounter an error when trying to build the documentation website:
Expand Down
8 changes: 7 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env bash

JEKYLL_LINK_CHECKER=internal bundle exec jekyll serve --host localhost --port 4000 --incremental --livereload --open-url --trace
host="localhost"

if [[ "$DOCKER_BUILD" == "true" ]]; then
host="0.0.0.0"
fi

JEKYLL_LINK_CHECKER=internal bundle exec jekyll serve --host ${host} --port 4000 --incremental --livereload --open-url --trace
14 changes: 14 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: "3"

services:
doc_builder:
image: ruby:3.2.4
volumes:
- .:/app
working_dir: /app
ports:
- "4000:4000"
command: bash -c "bundler install && bash build.sh"
environment:
BUNDLE_PATH: /app/vendor/bundle # Avoid installing gems globally.
DOCKER_BUILD: true # Signify build.sh to bind to 0.0.0.0 for effective doc access from host.
Loading