Skip to content

Theme development with Docker

Eduardo Gómez edited this page Aug 21, 2019 · 5 revisions

First of all, thank you so much to D3473R for his awesome job on this! He make it possible! 🙌🏼


Development mode

The following steps will guide you so that you can have a development environment on your machine without having to install Ghost:

  1. Install Docker and docker-compose.

  2. Install Nodejs and npm.

  3. Clone or download this repository.

  4. Open a Terminal and go to the src directory.

  5. Run npm install.

  6. Start Docker.

  7. Run npm run docker-watch.

Now you have an instant development setup and when you make changes you will see them right into the browser (hot-reloading).

You can see your blog here: http://localhost:3000 and you can access to the admin here: http://localhost:3000/ghost.

The credentials for the admin are the following:

User: liebling@example.com
Password: 0123456789

If you add new files you will need to run docker-compose restart manually, this is because of this (from Ghost docs):

If you add any new files to your theme during development, you'll need to restart Ghost to see the changes take effect.

Production mode

When you're ready you can build the theme for production just by running npm run production (within the src directory).

This command will generate the file liebling.zip in the root of the theme directory. Now you can upload this file to your own Ghost instance 😎.