Authoring Blog Posts w/ Markdown, Astro, and Caprover


This blog post was written directly from Neovim in an .mdx file and pushed to the main branch of my blog’s repository. The project is a delightful little Astro app with a few extras sprinkled in to make authoring these kinds of blog posts too easy. I say too easy because writing some markdown and pushing a commit gives me too much freedom to send my thoughts into the wild.
What’s Caprover?
I think the joy of developing a blog-style portfolio with Astro is well known, but Caprover is something that I feel doesn’t get enough attention. ‘Bring your own PaaS’ tools have been a hot topic since Heroku ended it’s free tier and folks are reminded that a cheap VPS can be a really powerful way to get your projects out into the world (This is running on the cheapest droplet Digital Ocean allows me to spin up).
Coolify & Dokku are some popular names in this space. Syntax hosted an exceptional podcast episode exploring the different choices you can make Episode 730 - Own your own PaaS.
In exploring some of these options I really liked the offering from Caprover - they offered a one click installation into a Digital Ocean droplet and after connecting a domain and installing a CLI tool you’re basically in business.
They have an admin dashboard to list and monitor your deployed applications. SSL certs are a click away with built-in support using LetsEncrypt.
Deploying Apps with Caprover
Once Caprover is installed on your server getting an application ready to deploy is as easy as adding a Dockerfile and a special captain-definition file into the root of your directory.
{
"schemaVersion": 2,
"dockerfilePath": "./Dockerfile"
}
This file really just points to your run of the mill Dockerfile.
From there really all it takes to push that repository to your server and build the container is to run one command from your repository.
caprover deploy
Automated Deployments
The brilliant part comes from setting up automated builds through Github (Or Bitbucket, Gitlab & Others). From your Caprover dashboard you can generate a webhook URL by simply adding your repository information.
Add that URL into your repository and every time you push to your designated repo (main, release, etc) a POST request is sent to your server to trigger a build.
Next Steps
Now that this pipeline is in place I am hoping to post some more content to my site as well as deploy more applications to my Caprover instance. I really like how Caprover gently exposes automated deployments and using Docker as a tool for managing your applicaton.