feat: add Coolify deployment proxy

Route the Coolify HTTPS domain through an internal Nginx proxy to Next.js and Socket.IO. Keep app/backing services private, preserve local development socket URLs, and document Coolify Compose setup.
This commit is contained in:
i vib committed 2026-10-23 20:53:34 -07:00
1 parent fcc4f4db2d
commit e52e25e990
6 files changed
+92 -21

No files matched your search

+8 -6
View File
@@ -6,15 +6,17 @@ Production container definitions for the split architecture:
- `web`: standalone Next.js frontend and admin console on port 3000, running as a non-root user.
- `ingestion`: Express + Socket.IO process on port 4000, running as a non-root user.
- `proxy`: Nginx reverse proxy on internal port 80. Coolify routes the public domain to this service; `/socket.io/` is forwarded to ingestion and other paths to web.
- `redis`: private Compose service reserved for the planned shared-buffer integration; current application code does not consume it.
- `postgres`: private Compose service reserved for metadata integration; current application code does not use Prisma at runtime. Collected events must remain in CSV files.
## Build and Run
## Coolify Compose Deployment
- Run from the repository root with Docker Engine and the Compose plugin installed.
- Copy `.env.example` to `.env` and provide non-empty deployment values; Compose deliberately has no committed secret defaults.
- Validate and start with `docker compose --env-file .env -f docker/docker-compose.yml config` and `docker compose --env-file .env -f docker/docker-compose.yml up --build -d`.
- Only the web and ingestion ports are published. PostgreSQL and Redis remain private to the Compose network.
- Create a Git-based Docker Compose application from branch `main`.
- Set Base Directory to repository root `/` and Compose Location to `docker/docker-compose.yml`.
- Set every required interpolated variable in Coolify: JWT/admin secrets and credentials, `DATABASE_URL`, and `POSTGRES_PASSWORD`.
- Add the public domain to service `proxy` at internal port `80`. Coolify manages proxy labels in its normal Compose mode; do not enable Raw Compose mode or add direct host port mappings.
- The `web`, `ingestion`, Redis, and PostgreSQL services are private on the Compose network. Only the proxy is exposed to Coolify's domain proxy.
- The `datastack-data` named volume persists ingestion CSVs; `pgdata` persists PostgreSQL files.
- The web container does not yet share/read `datastack-data`, and neither Redis nor PostgreSQL is wired into runtime code. Those are later roadmap phases, so cross-process reads and metadata durability are not established by these images.
- Health checks probe the public landing route, ingestion `/health`, Redis ping, and PostgreSQL readiness. These checks do not establish application-level shared-storage readiness.
- Health checks probe the web landing route, ingestion `/health`, proxy route, Redis ping, and PostgreSQL readiness. These checks do not establish application-level shared-storage readiness.