@@ -72,10 +72,45 @@ Changes pushed to our `main` branch will automatically trigger [Jekyll] to
7272build our site from that branch and push the result to our ` asf-site `
7373branch, where they will be served on [ our production site] [ production ] .
7474
75+ ## Testing using Docker environment
76+
77+ A containerized development environment can be built using the local
78+ Dockerfile. You can build it with the following command:
79+
80+ ``` bash
81+ docker build -t fluo-site-dev .
82+ ```
83+
84+ This action will produce a ` fluo-site-dev ` image, with all the website's build
85+ prerequisites preinstalled. When a container is run from this image, it
86+ will perform a ` jekyll serve ` command with the polling option enabled,
87+ so that changes you make locally will be immediately reflected after
88+ reloading the page in your browser.
89+
90+ When you run a container using the ` fluo-site-dev ` image, your current working
91+ directory will be mounted, so that any changes made by the build inside
92+ the container will be reflected in your local workspace. This is done with
93+ the ` -v ` flag. To run the container, execute the following command:
94+
95+ ``` bash
96+ docker run -it -v " $PWD " :/mnt/workdir -p 4000:4000 fluo-site-dev
97+ ```
98+
99+ While this container is running, you will be able to review the rendered website
100+ in your local browser at the address printed in the shell ([ http://0.0.0.0:4000/ ] ( http://0.0.0.0:4000/ ) ).
101+
102+ Appending ` /bin/bash ` to the end of the docker command above will provide shell access. This is useful for adding new
103+ gems, or modifying the Gemfile.lock for updating existing dependencies.
104+ When using shell access, the local directory must be mounted to ensure
105+ the Gemfile and Gemfile.lock updates are reflected in your local
106+ environment so you can create a commit and submit a PR.
107+
108+ You may need to manually delete the ` _site ` or ` .jekyll-cache ` directories if
109+ they already exist and are causing issues with the build.
110+
75111[ Jekyll ] : https://jekyllrb.com/
76112[ production ] : https://fluo.apache.org
77113[ ti ] : https://github.com/apache/fluo-website/workflows/CI/badge.svg
78114[ tl ] : https://github.com/apache/fluo-website/actions
79115[ li ] : http://img.shields.io/badge/license-ASL-blue.svg
80116[ ll ] : https://github.com/apache/fluo-website/blob/main/LICENSE
81-
0 commit comments