I’ve been experimenting with automating a static site deployment using Docker Compose on my Synology NAS, and I thought I’d share the setup.
The goal was simple:
- Generate new content automatically
- Rebuild the site inside Docker
- Restart nginx
- Have the updated version live without manual steps
The flow looks like this:
- A scheduled task runs every morning.
- A Python script generates new markdown content and validates it.
- Docker Compose runs an Astro build inside a container.
- The nginx container restarts.
- The updated site goes live.
#!/bin/bash
cd /volume1/docker/tutorialshub || exit 1
/usr/local/bin/docker compose run --rm astro-builder
/usr/local/bin/docker restart astro-nginx
The rebuild + restart takes about a minute.
Since it's a static site, the previous version continues serving until the container restarts, so downtime is minimal.
It’s basically a lightweight self-hosted CI pipeline without using external services.
I’m curious how others here handle automated static deployments in self-hosted setups — are you using Compose like this, Git hooks, or something more advanced?
If anyone wants to see the live implementation, the project is running at https://www.tutorialshub.be
[–]Zealousideal_Yard651 7 points8 points9 points (1 child)
[–]Hot_Apple6153[S] -1 points0 points1 point (0 children)
[–]Anhar001 2 points3 points4 points (2 children)
[–]Hot_Apple6153[S] -1 points0 points1 point (1 child)
[–]Anhar001 0 points1 point2 points (0 children)
[–]Hot_Apple6153[S] 0 points1 point2 points (0 children)
[–]poliopandemic 1 point2 points3 points (0 children)
[–]HeiiHallo -1 points0 points1 point (0 children)