Local development environment for Jekyll sites via Docker.
To run the image in your project, follow the following steps:
First make sure Docker engine is running and that you can use the Docker CLI, by installing Docker Desktop, for example.
Copy compose.yaml
and docker-entrypoint.sh
from this repository into the project's root directory containing your Jekyll website and your Gemfile
(otherwise the site can't build).
cd your/project/directory/
git clone --depth 1 [email protected]:VSteinborn/Docker-Jekyll.git # get repository files from Github
ln ./Docker-Jekyll/compose.yaml . # create a symbolic link of compose.yaml in the project's root directory
ln ./Docker-Jekyll/docker-entrypoint.sh . # similarly for docker-entrypoint.sh
docker compose up
Using the above command, the application name will be jekyll-dev
in Docker, the localhost's port 4000
will listen for traffic and finally, the project directory is bind-mounted to the Docker container's /site
directory.
Feel free to change the settings to your use case.
After following the above steps site should be running at http://0.0.0.0:4000/
in the browser.
Additionally, any file changes in the project directory will update the site at http://0.0.0.0:4000/
after reloading the page.
to stop and remove the Docker application simply run:
docker compose down