Replaces the bare-metal `composer run dev` workflow with a fully containerized 9-service stack orchestrated by docker compose. Single command brings up the full app — three subdomains (marketing / account / admin) reachable via Traefik with TLS, MariaDB + Valkey + Mailpit + Vite HMR + Horizon + scheduler all wired in. Components: - docker-compose.yml: traefik, app (php-fpm), web (nginx), mariadb, valkey, mailpit, vite, horizon, scheduler. - docker/: Dockerfiles, nginx config, entrypoint scripts. - Makefile: convenience targets (up / down / logs / shell / migrate / seed / test / pint / etc). - .env.docker.example: template for Docker-stack environment vars (separate from website/.env so bare-metal devs aren't disrupted). - website/vite.config.ts: server.host / origin / hmr / cors hooks driven by VITE_HOST / VITE_ORIGIN / VITE_HMR_HOST so the same config serves both bare-metal and Docker. - website/bootstrap/app.php: redirectGuestsTo() now uses request()->getScheme() so http: dev hosts don't get force-https redirects. - composer.json: drops laravel/sail (replaced by this stack). - docs/superpowers/specs/2026-04-25-docker-compose-dev-environment-design.md: full design spec. Bare-metal `composer run dev` workflow stays usable for anyone who prefers it — Docker stack reads .env.docker, doesn't fight website/.env. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import { defineConfig } from 'vite'
|
|
import laravel from 'laravel-vite-plugin'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vuetify from 'vite-plugin-vuetify'
|
|
|
|
export default defineConfig({
|
|
plugins: [
|
|
laravel({
|
|
input: ['resources/ts/app.ts'],
|
|
refresh: true,
|
|
}),
|
|
vue({
|
|
template: {
|
|
transformAssetUrls: {
|
|
base: null,
|
|
includeAbsolute: false,
|
|
},
|
|
},
|
|
}),
|
|
vuetify({
|
|
styles: {
|
|
configFile: 'resources/styles/variables/_vuetify.scss',
|
|
},
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./resources/ts', import.meta.url)),
|
|
'@images': fileURLToPath(new URL('./resources/images/', import.meta.url)),
|
|
'@styles': fileURLToPath(new URL('./resources/styles/', import.meta.url)),
|
|
'@layouts': fileURLToPath(new URL('./resources/ts/@layouts', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
host: process.env.VITE_HOST ?? 'localhost',
|
|
// When running inside the Docker stack, Vite is reached via Traefik at
|
|
// a public hostname. VITE_ORIGIN tells the laravel-vite-plugin
|
|
// what URL to write into public/hot so the browser can fetch modules.
|
|
origin: process.env.VITE_ORIGIN || undefined,
|
|
// Vite 7 defaults to a strict CORS regex that doesn't allow multi-label
|
|
// .localhost hosts. When in Docker mode, allow any *.docker.localhost.
|
|
cors: process.env.VITE_HMR_HOST
|
|
? { origin: /^https?:\/\/.+\.docker\.localhost(?::\d+)?$/ }
|
|
: true,
|
|
hmr: process.env.VITE_HMR_HOST
|
|
? {
|
|
host: process.env.VITE_HMR_HOST,
|
|
protocol: process.env.VITE_ORIGIN?.startsWith('https') ? 'wss' : 'ws',
|
|
clientPort: process.env.VITE_ORIGIN?.startsWith('https') ? 443 : 80,
|
|
}
|
|
: undefined,
|
|
watch: {
|
|
ignored: ['**/storage/framework/views/**'],
|
|
},
|
|
},
|
|
build: {
|
|
chunkSizeWarningLimit: 5000,
|
|
},
|
|
optimizeDeps: {
|
|
exclude: ['vuetify'],
|
|
},
|
|
})
|