Multi-stage images: web (workspace build baked into unprivileged nginx with SPA fallback, asset caching, /healthz) and api (pnpm deploy bundle with the prisma CLI for migrate-on-start, non-root, node-based healthcheck). deploy/compose/docker-compose.yml defines the stage stack (web, api, db) with frontend/internal networks, localhost-only published ports for the host reverse proxy, log rotation, and named volumes; .env.example documents every variable. compose.dev.yml layers hot-reloading dev containers (or database-only usage) over the same definition. Verified locally: full stack healthy, SPA fallback, readyz green after automatic migration, db not reachable from outside. Closes #6 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
14 lines
399 B
TypeScript
14 lines
399 B
TypeScript
import react from '@vitejs/plugin-react';
|
|
import { defineConfig } from 'vite';
|
|
|
|
export default defineConfig({
|
|
plugins: [react()],
|
|
server: {
|
|
// Native dev: api on localhost:3001 (3000 may be occupied by other
|
|
// projects). Containerized dev overrides this via VITE_API_PROXY_TARGET.
|
|
proxy: {
|
|
'/api': process.env.VITE_API_PROXY_TARGET ?? 'http://localhost:3001',
|
|
},
|
|
},
|
|
});
|