# Dokploy + Forgejo Deployment

This repo is now a monorepo of seven independent Astro sites under `sites/`.
Each site is a self-contained Dockerized Astro app with its own `src`, `public`,
`Dockerfile`, `package.json`, static build output, and RSS feed.

## Sites

| Site          | App directory       | Domain                         |
| ------------- | ------------------- | ------------------------------ |
| Research      | `sites/research`    | `research.neeldhara.blog`      |
| Vibes         | `sites/vibes`       | `vibes.neeldhara.blog`         |
| Puzzles       | `sites/puzzles`     | `puzzles.neeldhara.blog`       |
| Reflections   | `sites/reflections` | `reflections.neeldhara.blog`   |
| Poetry        | `sites/poetry`      | `poetry.neeldhara.blog`        |
| Reviews       | `sites/reviews`     | `reviews.neeldhara.blog`       |
| Art           | `sites/art`         | `art.neeldhara.blog`           |

The `.email` domains can be used as temporary aliases while DNS/certificates for
`.blog` are being finalized.

Each site exposes its own RSS feed at `/rss.xml`, for example:

- `https://research.neeldhara.blog/rss.xml`
- `https://puzzles.neeldhara.blog/rss.xml`

## Local Commands

Build every site:

```bash
npm run build:sites
```

Build one site:

```bash
npm run build --prefix sites/puzzles
```

Run one site locally:

```bash
npm run dev --prefix sites/research
```

The root `Dockerfile` is a temporary legacy compatibility image for the old
all-in-one Dokploy app. New Dokploy apps should use the `Dockerfile` inside each
`sites/<site>` directory.

## Forgejo Setup

All Dokploy apps should point at the same Forgejo repository:

```text
ssh://git@git.neeldhara.email:222/Blogs/blogs.git
```

Use branch `main`.

Forgejo Actions runs `npm ci` once at the repo root and then builds each site
directory.

## Dokploy Setup

Use one Dokploy project named `Blogs` with seven Applications.

Each Application should:

1. Use the same Forgejo repo and `main` branch.
2. Use the matching app directory as its build/root path, e.g. `sites/research`.
3. Build from that directory's `Dockerfile`.
4. Route exactly one site domain to container port `80`.
5. Avoid path prefixes or add-prefix middleware.

Suggested applications:

| Dokploy application | Root path           | Domain                         |
| ------------------- | ------------------- | ------------------------------ |
| `blog-research`     | `sites/research`    | `research.neeldhara.blog`      |
| `blog-vibes`        | `sites/vibes`       | `vibes.neeldhara.blog`         |
| `blog-puzzles`      | `sites/puzzles`     | `puzzles.neeldhara.blog`       |
| `blog-reflections`  | `sites/reflections` | `reflections.neeldhara.blog`   |
| `blog-poetry`       | `sites/poetry`      | `poetry.neeldhara.blog`        |
| `blog-reviews`      | `sites/reviews`     | `reviews.neeldhara.blog`       |
| `blog-art`          | `sites/art`         | `art.neeldhara.blog`           |

For `.email` testing, use the corresponding `*.neeldhara.email` domains.

## Verification

After deployment:

```bash
curl -I https://research.neeldhara.blog/
curl -I https://research.neeldhara.blog/_astro/privacy.WNqiFCQe.css
curl -I https://research.neeldhara.blog/rss.xml
curl -I https://puzzles.neeldhara.blog/rss.xml
```

Expected result: `200 OK` for pages, assets, and RSS.

The container health check should return `204`:

```bash
curl -I https://research.neeldhara.blog/nginx-health
```

## Notes

The old all-in-one app can stay online during migration. Once all seven new
Dokploy Applications are working, remove the domains from the old app and delete
it from Dokploy.
