documentation-developer
documentation-developer copied to clipboard
Dockerized launching mkdocs server
| Question | Answer |
|---|---|
| JIRA Ticket | n/a |
| Versions | 4.6, 5.0 |
| Edition | All editions |
This PR adds Dockerfile and compose.yaml configuration for docker compose to launch the Documentation page locally by simply stating:
docker compose up --watch
You can launch it also in a detached mode:
docker compose up -d
but then any local changes to the doc won't be reloaded.
By default it will launch mkdocs server at http://0.0.0.0:8000/en/latest/
To use different port (since 8000 can be already occupied by e.g., Symfony dev server), before running docker compose, run:
export MKDOCS_PORT=8888
where 8888 is the desired port.
The main pain point right now is that on Ubuntu python packages are externally managed and doing pip -r requirements.txt is not going to work OOTB.
Known issues
I'm not able to make mkdocs server automatically reload after changes, regardless of if I use --watch or --dirty option. As a workaround, docker will restart the service after any changes. The restart is triggered after about ~10 seconds and it takes extra ~20 seconds to rebuild the server.
Preview of modified files: no change to preview.