feat: add local dev workflow with hot reload via Traefik
Route dev domain through Traefik to host:3001 instead of Docker container, enabling instant hot reload. Expose PostgreSQL and Redis ports to localhost for local dev server connectivity. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
19e8730d41
commit
9fad8af225
3 changed files with 34 additions and 1 deletions
17
CLAUDE.md
17
CLAUDE.md
|
|
@ -81,7 +81,8 @@ quest-vorteq/
|
|||
├── traefik/
|
||||
│ ├── traefik.yml # Traefik configuration
|
||||
│ ├── acme.json # SSL certificates (gitignored)
|
||||
│ └── config/ # Dynamic Traefik config
|
||||
│ └── config/
|
||||
│ └── dev-local.yml # Routes dev domain → host:3001 for local dev server
|
||||
├── prisma/
|
||||
│ ├── schema.prisma # PostgreSQL schema (auth + quest + ship/alloc/finance/paint/doc/wave/lts domains)
|
||||
│ ├── migrations/
|
||||
|
|
@ -170,6 +171,8 @@ src/components/forms/ # Shared form components
|
|||
- Orders: implemented (list page with search and CSV export, HDC exception)
|
||||
- Remaining: shipments, coil-activity, invoices, shipment-requests, allocation-requests, jobs, admin pages
|
||||
|
||||
**Dev workflow:** Local Next.js dev server with hot reload via `PORT=3001 npm run dev`. Traefik routes `dev.quest.vorteq.wulf.cloud` to host:3001 via `traefik/config/dev-local.yml`. The `app-dev` Docker container should be stopped during local dev to avoid route conflicts.
|
||||
|
||||
**Auth status:** Better Auth is configured with Prisma adapter. A custom login endpoint exists at `/api/auth/login`. Auth middleware is temporarily disabled in dev mode (`DEV_MODE=true` bypasses to a mock admin session). The dev domain (`dev.quest.vorteq.wulf.cloud`) also bypasses auth in middleware.
|
||||
|
||||
**Git:** Currently only `main` branch. No `development` branch yet.
|
||||
|
|
@ -334,6 +337,18 @@ docker compose logs -f vorteq-dev # Tail dev container logs
|
|||
npm run lint && npm run typecheck && npm test
|
||||
```
|
||||
|
||||
### Local Development (Hot Reload)
|
||||
```bash
|
||||
# Start local dev (instead of Docker container)
|
||||
docker compose stop app-dev # Release the competing Traefik route
|
||||
PORT=3001 npm run dev # Run in a tmux pane — hot reload at https://dev.quest.vorteq.wulf.cloud
|
||||
|
||||
# Stop local dev (restore containerized version)
|
||||
# Ctrl+C the dev server, then:
|
||||
docker compose start app-dev
|
||||
```
|
||||
Traefik routes `dev.quest.vorteq.wulf.cloud` → `http://172.17.0.1:3001` via `traefik/config/dev-local.yml`. CI/CD pipeline is unchanged — pushes to `main` still build and deploy the production container.
|
||||
|
||||
## Environment Variables
|
||||
|
||||
```env
|
||||
|
|
|
|||
|
|
@ -36,6 +36,8 @@ services:
|
|||
restart: unless-stopped
|
||||
networks:
|
||||
- web
|
||||
ports:
|
||||
- "127.0.0.1:5432:5432"
|
||||
environment:
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_MULTIPLE_DATABASES: vorteq_dev,vorteq_test,vorteq_prod
|
||||
|
|
@ -55,6 +57,8 @@ services:
|
|||
restart: unless-stopped
|
||||
networks:
|
||||
- web
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379"
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
healthcheck:
|
||||
|
|
|
|||
14
traefik/config/dev-local.yml
Normal file
14
traefik/config/dev-local.yml
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
http:
|
||||
routers:
|
||||
dev-local:
|
||||
rule: "Host(`dev.quest.vorteq.wulf.cloud`)"
|
||||
entrypoints:
|
||||
- websecure
|
||||
tls:
|
||||
certResolver: letsencrypt
|
||||
service: dev-local
|
||||
services:
|
||||
dev-local:
|
||||
loadBalancer:
|
||||
servers:
|
||||
- url: "http://172.17.0.1:3001"
|
||||
Loading…
Add table
Add a link
Reference in a new issue