Install Jekyll + Docker to run Github Pages locally
Already built Jekyll person website!!! Want to test this on local machine?? Then this article is right for you.
Introduction
After a long time spent on busy university life and other projects, I have decided to get back to writing blogs. In order to publish blogs effectively, I need to run the my personal Jekyll website locally. Initially, I followed these steps to install Jekyll with gem commands on my Macbook Pro 2016 (Catalina OS). However, I have not been successful at all after many failed attempts (see my terminal output below). Therefore, I will come with my next approach of using Docker to run Jekyll website locally.
Running Jekyll With Docker
Docker is a helpful tool for packing, shipping and running applications within “containers”. In this context, I will use Docker Compose to run my wesite container in local environment. See the config in my docker-compose.yml file.
As can be seen from the config file, I utilized the Docker image from this link for the Jekyll service. Customize your container name and add the Github Token from following these steps. Finally, running the command “docker-compose up” on Terminal and then your container is deployed successfully. Additionally, it also can update the latest changes in your project folder (how amazing this is!!!)
View your website at http://127.0.0.1:4000/.
Conclusion
If you have read until this line, I am appreciated your support for my blog. Stay tuned and looking forward to my next article!!!