Move shared infrastructure to a separate Infrastructure repo

Postgres, Zitadel, SeaweedFS, RabbitMQ and Jaeger no longer run as part
of this stack. They're shared services (used by Musify, Ping and
docker-manager) that now live in a separate Infrastructure repository
and must already be running.

deploy/compose.yml keeps only what's specific to Musify: its own
database connection, its own OIDC app and storage bucket (created
against the shared Zitadel/SeaweedFS via zitadel-init/seaweedfs-init),
and the application containers. A new wait-for-postgres one-shot
replaces the in-file Postgres health check, which no longer works now
that Postgres lives in a different compose project.

compose.prod.yml joins Infrastructure's infra-net network instead of
running its own copies. Docs and READMEs updated to match.
This commit is contained in:
2026-09-21 22:09:08 +02:00
parent c5748e9765
commit 63018a7c72
11 changed files with 261 additions and 369 deletions
+8 -1
View File
@@ -34,6 +34,11 @@ this way**.
Login: Client ◄──► Zitadel (:8080, OIDC) → Musify.Api validates the JWT
```
PostgreSQL, Zitadel, SeaweedFS and RabbitMQ are not run by this repository.
They're shared infrastructure, provided by the separate `Infrastructure`
repository, that this stack connects to the same way any other project
does.
## Stack
- **.NET 10**, C#. Minimal APIs (`Musify.Api`), Worker Service (`Musify.Worker`), ASP.NET + YARP (`Musify.StreamingGateway`).
@@ -48,4 +53,6 @@ this way**.
A single repo: `backend/` (the six .NET projects), `web-player/` (the
SvelteKit web client), `deploy/` (Docker Compose stacks and scripts), and
`docs/`.
`docs/`. The shared infrastructure (Postgres, Zitadel, SeaweedFS, RabbitMQ,
Jaeger) lives in the separate `Infrastructure` repository, a sibling of this
one, and is not part of this layout.
+4 -4
View File
@@ -15,10 +15,10 @@
| **Domain/Application/Infrastructure** | Domain + use cases + shared infrastructure (EF, S3, MassTransit, ffmpeg) | Logic shared between the API and the Worker |
| **StreamingGateway** | Reverse proxy (YARP) that validates the ticket and serves the audio (`.m4a`) from SeaweedFS | Scales with byte traffic independently of the API, and keeps SeaweedFS private behind it |
| **Worker** | Consumes MassTransit events: transcodes audio to `.m4a` and generates thumbnails | Keeps CPU/IO-heavy work off the HTTP request path |
| **PostgreSQL** | Metadata (users, tracks, playlists, upload intents) | n/a |
| **RabbitMQ** | Event queue + transactional outbox | Decouples creation from processing |
| **SeaweedFS** | Object storage (S3 + filer) | Stores originals and derivatives (`.m4a` audio, thumbnails) |
| **Zitadel** | Identity (OIDC/OAuth2) | Login and JWT issuance |
| **PostgreSQL** *(shared, runs in the separate `Infrastructure` repo)* | Metadata (users, tracks, playlists, upload intents) | n/a |
| **RabbitMQ** *(shared, runs in Infrastructure)* | Event queue + transactional outbox | Decouples creation from processing |
| **SeaweedFS** *(shared, runs in Infrastructure)* | Object storage (S3 + filer) | Stores originals and derivatives (`.m4a` audio, thumbnails) |
| **Zitadel** *(shared, runs in Infrastructure)* | Identity (OIDC/OAuth2) | Login and JWT issuance |
## Main flows
+17 -14
View File
@@ -5,15 +5,19 @@ and prod) live in [deploy/README.md](../deploy/README.md).
## Startup
Bring up the separate `Infrastructure` repository first (Postgres, Zitadel,
SeaweedFS, RabbitMQ, Jaeger, see its own README for the exact command), then:
```sh
docker compose -f deploy/compose.yml -f deploy/compose.dev.yml up -d
```
That one command brings up the infrastructure and runs the one-shot bootstrap
jobs: generates the RS256 stream-ticket keys in `deploy/keys/`, applies the
EF Core migrations, and provisions Zitadel (project + OIDC apps), writing the
client ids into `deploy/.env`. Full details, including how to run the apps in
Docker with `--profile apps`, are in [deploy/README.md](../deploy/README.md).
That runs Musify's own one-shot bootstrap jobs: it generates the RS256
stream-ticket keys in `deploy/keys/`, applies the EF Core migrations, creates
Musify's storage bucket, and provisions Zitadel (project + OIDC apps),
writing the client ids into `deploy/.env`. Full details, including how to run
the apps in Docker with `--profile apps`, are in
[deploy/README.md](../deploy/README.md).
## Applications
@@ -31,16 +35,15 @@ npm --prefix web-player run dev # :5173
| Musify.Api | 5111 (`/scalar/v1`, `/openapi/v1.json`) |
| Musify.StreamingGateway | 8081 (`/health`, `/media/...`) |
| web-player | 5173 (`npm run dev`) or 3000 (container) |
| SeaweedFS S3 / filer / master | 8333 / 8888 / 9333 |
| Zitadel | 8080 |
| PostgreSQL | 59000 (→ 5432 in the container) |
| RabbitMQ AMQP / management | 5672 / 15672 |
| Jaeger UI / OTLP | 16686 / 4317 |
| pgAdmin (`-Tools`) | 5050 |
DB: `musify_db`, user `postgres`/`postgres`. S3 bucket: `webapi-storage`
(credentials `admin_access_key`/`admin_secret_key`). All of these come from
`deploy/.env`.
Postgres, Zitadel, SeaweedFS, RabbitMQ and Jaeger are not run by this repo.
Their ports are documented in the separate `Infrastructure` repository's own
README.
DB: `musify_db`, user `postgres`/`postgres` on Infrastructure's shared
Postgres. S3 bucket: `webapi-storage` (credentials
`admin_access_key`/`admin_secret_key`, also Infrastructure's). All of these
come from `deploy/.env`.
## Migrations
+3 -1
View File
@@ -69,6 +69,8 @@ real Postgres + SeaweedFS), and `Musify.StreamingGateway.Tests`. Details in
## Other folders
- **`deploy/`**: self-contained Docker Compose stacks (dev and prod). See
- **`deploy/`**: Musify's own Docker Compose stacks (dev and prod). The
shared infrastructure (Postgres, Zitadel, SeaweedFS, RabbitMQ, Jaeger)
lives in the separate `Infrastructure` repo instead. See
[../deploy/README.md](../deploy/README.md).
- **`docs/`**: this documentation.