3.8 KiB
Dokploy + Forgejo Deployment
This repo is set up as one Dockerized multisite Astro app. The build creates seven static sites and Nginx serves the correct one based on the incoming subdomain.
Sites
| Host | Static output | Content collection |
|---|---|---|
research.neeldhara.blog |
dist/research |
src/content/research |
vibes.neeldhara.blog |
dist/vibes |
src/content/vibes |
puzzles.neeldhara.blog |
dist/puzzles |
src/content/puzzles |
reflections.neeldhara.blog |
dist/reflections |
src/content/reflections |
poetry.neeldhara.blog |
dist/poetry |
src/content/poetry |
reviews.neeldhara.blog |
dist/reviews |
src/content/reviews |
art.neeldhara.blog |
dist/art |
src/content/art |
Each site has its own root feed at /rss.xml, for example:
https://research.neeldhara.blog/rss.xmlhttps://puzzles.neeldhara.blog/rss.xml
Local Commands
Build all sites:
npm run build
Build one site:
BLOG_SITE=puzzles npm run build:site
Run one site locally:
BLOG_SITE=research npm run dev:site
Build the production container locally:
docker compose build
Forgejo Setup
- Create an empty Forgejo repository, for example
neeldhara/blogs. - Point this local repo at Forgejo:
git remote set-url origin <forgejo-ssh-or-https-url>
git push -u origin main
- Enable Forgejo Actions if you want CI. The workflow in
.forgejo/workflows/build.ymlrunsnpm ciandnpm run buildon pushes and pull requests.
Forgejo Actions uses GitHub-Actions-like workflow syntax, but it is not identical to GitHub Actions. Keep this workflow intentionally simple unless the runner setup is known.
Dokploy Setup
Use the Docker Compose deployment path.
- In Dokploy, create a new Compose app.
- Connect it to the Forgejo repository. If Dokploy cannot access Forgejo directly, add a deploy key or use the repository HTTPS URL with credentials configured in Dokploy.
- Use the repository root as the build context.
- Use
docker-compose.ymlfrom this repo. - Route all seven domains to the
blogsservice on port80. - Enable HTTPS certificates for each domain in Dokploy.
The container builds all seven sites with npm run build. Nginx reads the Host header and serves the matching directory using deploy/nginx.conf.
The Compose app attaches to Dokploy's external dokploy-network so Dokploy's proxy can reach the container. If your Dokploy installation uses a different proxy network name, update docker-compose.yml.
DNS
Point these DNS records at the Dokploy host:
research.neeldhara.blog
vibes.neeldhara.blog
puzzles.neeldhara.blog
reflections.neeldhara.blog
poetry.neeldhara.blog
reviews.neeldhara.blog
art.neeldhara.blog
Use A records if pointing directly at the server IP, or CNAME records if you front Dokploy with another canonical hostname.
Verification
After deployment:
curl -I https://research.neeldhara.blog/
curl -I https://research.neeldhara.blog/rss.xml
curl -I https://puzzles.neeldhara.blog/100-prisoners/
curl -I https://puzzles.neeldhara.blog/rss.xml
Expected result: 200 OK for each.
Bad Gateway Checklist
If Dokploy shows Bad Gateway:
- Confirm the app deployment finished successfully and the
blogscontainer is running. - In the domain settings, make sure each domain points to service
blogsand container port80. - Confirm the service is attached to
dokploy-network. - Check the container logs. Nginx should stay in the foreground; if it exits, the logs should show the config error.
- Redeploy after any Compose change so Dokploy recreates the container/network attachment.