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.
Here is a first crack at creating a docker image.
I am no docker guru. There are probably improvements to be made.
Currently, it is pushing an image into the package registry of my fork of the project.
Notes
The container expects the Lektor project source (the top-level directory which contains the
.lektorproject
file) to be mounted at/project
. If no volume is explicitly mounted there, the container defaults to working on the example project.Build output is written to
/output
.If no command-line is passed to the container, it will run the lektor server on port 5000. To do something else, specify a full Lektor command line, e.g.,
lektor build
when running the container.As things are now,
rsync
,imagemagick
andffmpeg
are installed, so thumbnailing and rsync publishing should work. (I have not tested these, however.)As things stand, Node is not installed. This means that
lektor-webpack
will probably not work. (Perhaps this should be reconsidered.)Currently, no local cache of PyPI packages is included in the image. That may be worth doing — not sure. (Lektor and it's dependencies are all installed, obviously, but it might be worth including a local wheel cache of common plugins and plugin dependencies.)
Examples
Edit the example project
If it all works as intended, you can edit the example site by doing something like
Once it appears (from console output) that the server has fired up, browse to http://localhost:5000/.
Edit your own project
To edit your own project, mount your project directory at the container’s
/project
:Build your project
To collect the built HTML, mount the directory you’d like the output written to to the container’s
/output
:Note that the build process will prune the output directory. It's probably best to start with an empty output directory.
Issue(s) Resolved
Fixes #970
Related Issues / Links
Description of Changes