Skip to content

Commit

Permalink
Containerize process for local development setup (#8220)
Browse files Browse the repository at this point in the history
* Containerize process for local development setup

Signed-off-by: hainenber <[email protected]>

* Revert list numbering to "1" for Jekyll convention

Signed-off-by: hainenber <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: kolchfa-aws <[email protected]>
Signed-off-by: Đỗ Trọng Hải <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: kolchfa-aws <[email protected]>
Signed-off-by: Đỗ Trọng Hải <[email protected]>

* Update CONTRIBUTING.md

Co-authored-by: kolchfa-aws <[email protected]>
Signed-off-by: Đỗ Trọng Hải <[email protected]>

---------

Signed-off-by: hainenber <[email protected]>
Signed-off-by: Đỗ Trọng Hải <[email protected]>
Co-authored-by: kolchfa-aws <[email protected]>
  • Loading branch information
hainenber and kolchfa-aws authored Sep 26, 2024
1 parent a6a3396 commit 6c5c04c
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 1 deletion.
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.

0 comments on commit 6c5c04c

Please sign in to comment.