There are many Ghost themes on Github without a proper live demo. I just wanted to download a few of them to see the result locally. Oh, and did I saw the pain to work between different machines?
This project solves all of that and makes the whole process efficient.
As I maintain many Ghost Themes, my pain was growing exponentially. I needed to develop & maintain those themes quickly, test them, using real content that makes sense. All of this without putting unnecessary stuff in the git repo of each theme.
I was always running after my tail as soon as I was switching between different themes or duplicating hundred of MB to duplicate my Ghost setup.
Have a consistent workflow to run Ghost locally within a Docker container. Once your local paths are define it’s really fun and easy to work between many themes.
Two-goal here:
- It’s for developers who needs to quickly re-start ghost on the fly (about 3 sec) while they develop a their Ghost themes.
- It’s for everyone who wants to see & try Ghost theme locally.
I have worked and re-work this workflow and with my experience, I can confirm it covers many use cases I have.
- Run Ghost images with tag
edgeorstable(you can choose them from: https://hub.docker.com/r/devmtl/ghostfire/tags/) - Run Ghost Themes I develop actively which are in my Github local setup.
- Rename
_my_themes_sampleto_my_themes - Run Ghost Themes I want to try on the fly. Just unzip any themes in the directory
_my_themesand your Ghost container will see it. - It shut down the containers automatically after 1 hours.
- When starting, the workflow tests many elements like:
- What is the Ghost version
- What is the Node version
- Ensure Ghost does response is up
- ToDo, 2021-01-11_23h23
The docker images I use are continuously integrated (built every day) thanks to Travis. See the latest images at: https://hub.docker.com/r/devmtl/ghostfire/tags/
Because this workflow syncs themes locally, you need to tweak some variables before anything.
- Duplicate
var-config-example.shand rename it asvar-config.sh - Configure your local environment within
var-config.sh ./run.sh- In your browser, go to
http://localhost:2368/&http://localhost:2368/ghost
That’s it!
- Executing
./runup.shruns thestableimage - Executing
./runedge.shruns theedgeimage - Executing
./rundown.shshutdown the container - Directory
theme_stableis where your Ghost Themes are considered stable. You should never copy anything manually in there. - Directory
theme_tryoutis where you can manually copy theme within. Copy and unzip Ghost theme you want to try here - Directory
contentis where the Ghost container mount its volume. You should never copy anything manually in there.
Thanks to the power of communities, this is where 1 + 1 = 3.
- Fork it
- Create your feature branch:
git checkout -b my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin my-new-feature - Submit a pull request
- This Git repo is available at:
https://github.com/firepress-org/ghost-local-dev-in-docker
- This git repo is under the GNU license information. Find it here.
- The Ghost’s software, is under the MIT license. Find it here.
At FirePress we do one thing and we do it with our whole heart: we host fully managed Ghost’s websites. The idea behind FirePress is to empower freelancers and small organizations to be able to build an outstanding mobile-first website.
We also offer a workshop where participants ends up with a website/blog they can easily operate themselves. Details are coming soon. It is available in those cities:
- Montréal - Canada
- Toronto - Canada
- New-York - USA
- Québec City - Canada
Because we believe your website should speak up in your name, we consider our mission completed once your site has become your impresario. Start your free trial here.
- Pascal Andy’s « now page »
- Follow me on Twitter
- Find more Ghost Themes on play-with-ghost.com