Dockerized launching mkdocs server #2924
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds
Dockerfile
andcompose.yaml
configuration fordocker compose
to launch the Documentation page locally by simply stating:You can launch it also in a detached mode:
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.