diff --git a/Caddyfile.dev b/Caddyfile.dev new file mode 100644 index 0000000..8cf4e30 --- /dev/null +++ b/Caddyfile.dev @@ -0,0 +1,15 @@ +# Development server. Production Caddyfile lives at docker/Caddyfile. +{ + frankenphp +} + +:8080 { + root public/ + encode zstd br gzip + php_server { + try_files {path} index.php + } + log { + output stdout + } +} \ No newline at end of file diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..da78559 --- /dev/null +++ b/dev.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# festbench-web dev: frankenphp (host binary) + vite HMR. +# MariaDB must be up: docker compose -f docker/develop.compose.yaml up -d +cd "$(dirname "$0")" +frankenphp run --config Caddyfile.dev & +FRANKEN=$! +npm run dev & +VITE=$! +trap 'kill $FRANKEN $VITE 2>/dev/null' INT TERM +wait \ No newline at end of file diff --git a/docker/develop.compose.yaml b/docker/develop.compose.yaml new file mode 100644 index 0000000..924e1f1 --- /dev/null +++ b/docker/develop.compose.yaml @@ -0,0 +1,26 @@ +# Development-only stack: MariaDB in a container so the base OS stays clean and +# the app talks TCP to a network-attached DB, mirroring the production topology +# (DB on a nearby host). Production deploys via the Dockerfile only — Coolify +# never sees this file. +services: + mariadb: + image: mariadb:11 + container_name: festbench-mariadb + restart: unless-stopped + environment: + MARIADB_DATABASE: festbench + MARIADB_USER: festbench + MARIADB_PASSWORD: festbench + MARIADB_ROOT_PASSWORD: festbench-root + ports: + - "127.0.0.1:3306:3306" + volumes: + - festbench-mariadb:/var/lib/mysql + healthcheck: + test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"] + interval: 5s + timeout: 3s + retries: 10 + +volumes: + festbench-mariadb: \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 9d701e6..e0dd334 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "livewire-starter-kit", + "name": "festbench-web", "lockfileVersion": 3, "requires": true, "packages": {