From a7df03468bd9647084c02a18a61482e72a9371c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20M=C3=BCnch?= Date: Fri, 20 Mar 2020 15:37:15 +0100 Subject: [PATCH] Add docker-compose support (#6890) * Add docker-compose support * Fix markdown style violations * Added additional description of docker setup * Update README.md Co-Authored-By: hguthrie * Add further instruction of the docker setup * Fix lint errors * Remove trailing spaces * Remove wrong quotes Co-authored-by: hguthrie --- README.md | 26 ++++++++++++++++++++++++++ docker-compose.yaml | 11 +++++++++++ 2 files changed, 37 insertions(+) create mode 100644 docker-compose.yaml diff --git a/README.md b/README.md index 67bde5bca8b..7503502a269 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ This site is built by [Jekyll](https://jekyllrb.com/), which is an open-source t You can build the site locally in the following ways: - [Installing the project dependencies locally](#build-locally) (Mac, Linux) +- [Using Docker (docker-compose)](#docker-docker-compose) (Mac, Linux, Windows) - [Using a Vagrant virtual machine](https://github.com/magento-devdocs/vagrant-for-magento-devdocs) (Mac, Linux, Windows) - [Build DevDocs in Windows](https://github.com/magento/devdocs/wiki/Build-DevDocs-in-Windows) (Windows 7 & 10) - [Building older versions of the documentation](#building-old-versions) @@ -141,6 +142,31 @@ exclude: >rake preview:all >``` +## Docker (docker-compose) + +Docker provides a quick and easy way to build and preview the documentation. You do not need to install Ruby dependencies manually. This Docker solution launches Jekyll inside the container in `watch` mode. +ruby dependency manually. The provided setup starts Jekyll inside the container in watch mode. +Every change of a markdown file will automatically trigger a rebuild of the documentation. + +1. Install [Docker](https://www.docker.com/get-started). If you have Docker installed, make sure Docker is running. + +1. Build and start the Docker environment. + +```bash +docker-compose up +``` + +1. Use the server address URL provided by the system response. + +For example: + +```terminal +jekyll_1 | Server address: http://127.0.0.1:4000/ +jekyll_1 | Server running... press ctrl-c to stop. +``` + +1. Press `Ctrl+C` in the serve terminal to stop the server. + ## Building old versions The published website contains documentation for the latest Magento releases only. For cases, when you need to view the content as it was for an earlier release, we created [tags](https://github.com/magento/devdocs/tags) in this repository. Typically, they point at the commit when the release notes were finalized and published. diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 00000000000..bbd6e90c73c --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,11 @@ +version: '3.6' + +services: + jekyll: + image: jekyll/jekyll:latest + command: jekyll serve --watch --incremental --open-url --livereload + ports: + - 4000:4000 + - 35729:35729 + volumes: + - .:/srv/jekyll