Β
FirePress.org |
play-with-ghost |
GitHub |
Twitter
Β
What is Ghost? β Ghost is an open-source software that lets you create your website with a blog. See the FAQ section for more details. This project makes it run in a Docker image.
- Multi-stage builds with aggressive optimization
- Security-focused: Non-root user execution with
gosu
privilege dropping - Multi-architecture support:
linux/amd64
,linux/arm64
,linux/arm/v7
- Production-ready:
config.production.json
template with best practices - Alpine Linux base for minimal attack surface (we don't maintain debian)
- Health checks with
curl
support - Labels based on the OpenContainer standard
- Conditional dependencies: Smart installation of
sharp
andsqlite3
- Enterprise-grade: Optimized for Docker Swarm deployments
We achieve significant size optimization through multi-stage builds and aggressive cleanup:
devmtl/ghostfire:stable ~320MB (optimized)
ghost:5.x-alpine ~380MB (official)
- Multi-architecture builds:
linux/amd64
,linux/arm64
,linux/arm/v7
- Comprehensive security scanning: Snyk, Dockle, Trivy vulnerability detection
- Performance testing: Lighthouse audits (localhost and online)
- Quality assurance: Linting using
super-linter
- Automated deployment: Continuous deployment to Docker Swarm clusters
- Smart caching: Build cache optimization for faster CI/CD
- Notification system: Slack notifications for build status
- Shared variables: Efficient job coordination and data sharing
- Best practices: Following enterprise DevOps standards
- Extreme visibility: Comprehensive logging and monitoring during builds
Want to try Ghost quickly? This is for you!
play-with-ghost.com is a playground to learn about Ghost. What's remarkable here, is that you have the option to log into the admin panel of each live demo available, by using dummy credentials.
In short, you can try Ghost on the spot without having to sign-up!
At this point, this docker image has been pulled more than 11 millions of time!
GHOSTFIRE_IMG="devmtl/ghostfire:stable"
docker run -d \
--name ghostblog \
-p 2368:2368 \
-e url=http://localhost:2368 \
${GHOSTFIRE_IMG}
GHOSTFIRE_IMG="devmtl/ghostfire:stable"
docker run -d \
--name ghostblog \
-p 2368:2368 \
-e url=http://localhost:2368 \
-v /myuser/localpath/ghost/content:/var/lib/ghost/content \
-v /myuser/localpath/ghost/config.production.json:/var/lib/ghost/config.production.json \
${GHOSTFIRE_IMG}
GHOSTFIRE_IMG="devmtl/ghostfire:stable"
docker run -d \
--name ghostblog \
-p 2368:2368 \
-e url=http://localhost:2368 \
-e NODE_ENV=development \
--health-cmd="curl -f http://localhost:2368/ || exit 1" \
--health-interval=30s \
--health-timeout=10s \
--health-retries=3 \
-v $(pwd)/content:/var/lib/ghost/content \
${GHOSTFIRE_IMG}
To configure the config.production.json
refer the ghost docs.
For the stable branch, I recommend using the tag from the first line:
devmtl/ghostfire:stable_5.120.4_<hash>_<date>
devmtl/ghostfire:stable_5.120.4
devmtl/ghostfire:stable
Find the latest tags on DockerHub here: https://hub.docker.com/r/devmtl/ghostfire/tags/
This is reserved for development and testing.
devmtl/ghostfire:edge_5.120.4_<hash>_<date>
devmtl/ghostfire:edge_5.120.4
devmtl/ghostfire:edge
Our Dockerfile uses a sophisticated 4-stage build process:
mynode
- Base Node.js environment with security tools (gosu, timezone setup)debug
- Package version debugging and validation layerbuilder
- Ghost installation and native dependency compilationfinal
- Minimal runtime image with only necessary components
- Non-root execution: Runs as
node
user for enhanced security - Privilege dropping: Uses
gosu
for secure step-down from root - File permissions: Proper ownership and permission management
- Minimal attack surface: Alpine Linux base with aggressive cleanup
- Vulnerability scanning: Integrated security scanning in CI/CD
Critical paths for data persistence:
/var/lib/ghost/content # All Ghost content, themes, uploads
/var/lib/ghost/config.production.json # Runtime configuration
/var/lib/ghost/content/logs # Application logs
/var/lib/ghost/content/data/ghost.db # SQLite database
Let's understand our processes. In this post Β« How we update hundreds of Ghost's websites on Docker Swarm? Β», we explain how we deploy Ghost in production and which best practices we do follow.
I open-sourced my setup here. Itβs a workflow to run Ghost locally within a Docker container. Once your local paths are defined, itβs enjoyable and easy to work between many themes.
- SQLite (default): Zero-configuration, file-based database at
/var/lib/ghost/content/data/ghost.db
- MySQL: Full support with connection configuration in
config.production.json
Ghost configuration is handled via config.production.json
with these key areas:
- Database connection: SQLite default or MySQL configuration
- Mail configuration: SMTP/Mailgun templates provided
- Logging: 7-day retention with 5-day rotation
- Content paths: Mapped to
/var/lib/ghost/content
- URL configuration: Flexible URL and SSL settings
Current Stack:
- Ghost: v5.120.4 (latest stable)
- Node.js: 20.19.2 on Alpine Linux 3.22
- Ghost CLI: v1.27.0
Check versions in running container:
docker exec <container-id> node --version
docker exec <container-id> ghost --version
Path consistency across versions:
- Ghost 5.x.x: /var/lib/ghost/content β
(current)
- Ghost 4.x.x: /var/lib/ghost/content
- Ghost 3.x.x: /var/lib/ghost/content
- Ghost 2.x.x: /var/lib/ghost/content
- Ghost 1.x.x: /var/lib/ghost/content
- Ghost 0.11.x: /var/lib/ghost (deprecated)
At FirePress we empower entrepreneurs and small organizations to create their websites on top of Ghost.
At the moment, our pricing for hosting one Ghost website is $15 (Canadian dollars). This price will be only available for our first 100 new clients, starting May 1st, 2019 π. See our pricing section for details.
More details about this announcement on Ghost's forum.
The power of communities pull request and forks means that 1 + 1 = 3
. You can help to make this repo a better one! Here is how:
- 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
Check this post for more details: Contributing to our Github project. Also, by contributing you agree to the Contributor Code of Conduct on GitHub. It's plain common sense really.
- This git repo is under the MIT license. Find it here.
- The Ghost's software is under the MIT license. Find it here.
- This Git repo is available at https://github.com/firepress-org/ghostfire
- Forked from the official Ghost image
Our mission is to empower freelancers and small organizations to build an outstanding mobile-first website.
Because we believe your website should speak up in your name, we consider our mission completed once your site has become your impresario.
For more info about the man behind the startup, check out my now page. You can also follow me on Twitter @askpascalandy.
β The FirePress Team π₯π°