Add mysql-debug to local development stack and update related configurations
This commit is contained in:
+4
-4
@@ -32,8 +32,8 @@ CONFIG_DB_SSL_MODE=DISABLED
|
||||
|
||||
# Debug DB credentials (used when CONFIG_DB_TARGET=debug)
|
||||
# Any blank debug value falls back to the live value above.
|
||||
CONFIG_DB_DEBUG_HOST=
|
||||
CONFIG_DB_DEBUG_USER=
|
||||
CONFIG_DB_DEBUG_PASSWORD=
|
||||
CONFIG_DB_DEBUG_DATABASE=
|
||||
CONFIG_DB_DEBUG_HOST=mysql-debug
|
||||
CONFIG_DB_DEBUG_USER=root
|
||||
CONFIG_DB_DEBUG_PASSWORD=debug_root_password
|
||||
CONFIG_DB_DEBUG_DATABASE=nnks_db_debug
|
||||
CONFIG_DB_DEBUG_SSL_MODE=DISABLED
|
||||
|
||||
@@ -16,9 +16,9 @@ Backend API for Copenhagen Truck Wash services.
|
||||
- PHP 8.2 CLI (optional, for host-side testing)
|
||||
|
||||
### Local Development
|
||||
To bring up the minimal development stack (Traefik, Redis, Caddy, and one PHP worker):
|
||||
To bring up the minimal development stack (Traefik, Redis, MySQL debug DB, Caddy, and one PHP worker):
|
||||
```powershell
|
||||
docker compose up -d traefik redis php1 caddy
|
||||
docker compose up -d traefik redis mysql-debug php1 caddy
|
||||
```
|
||||
|
||||
The API is accessible at:
|
||||
@@ -80,6 +80,19 @@ Optional overrides:
|
||||
- Skip image build: `-SkipBuild` or `SKIP_BUILD=1`
|
||||
- Force image rebuild: `-ForceBuild` or `FORCE_BUILD=1`
|
||||
|
||||
### Clone Live DB Into `mysql-debug` Service
|
||||
To refresh the docker-compose debug DB from live credentials in `.env`:
|
||||
|
||||
PowerShell:
|
||||
```powershell
|
||||
powershell -ExecutionPolicy Bypass -File .\scripts\clone-live-to-debug-db.ps1 -Force
|
||||
```
|
||||
|
||||
Bash:
|
||||
```bash
|
||||
FORCE=1 ./scripts/clone-live-to-debug-db.sh
|
||||
```
|
||||
|
||||
### Test Layout
|
||||
- `tests/Unit/*`: isolated unit and route-level behavior tests.
|
||||
- `tests/Integration/*`: Redis/DB-backed tests intended for Docker/CI environments.
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ Set-Location $RootDir
|
||||
|
||||
switch ($Action) {
|
||||
"start" {
|
||||
docker compose up -d traefik redis php1 caddy
|
||||
docker compose up -d traefik redis mysql-debug php1 caddy
|
||||
}
|
||||
"stop" {
|
||||
docker compose down
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ SERVICE="${2:-php1}"
|
||||
|
||||
case "$ACTION" in
|
||||
start)
|
||||
docker compose up -d traefik redis php1 caddy
|
||||
docker compose up -d traefik redis mysql-debug php1 caddy
|
||||
;;
|
||||
stop)
|
||||
docker compose down
|
||||
|
||||
+1
-1
@@ -14,5 +14,5 @@ if (-not $docker) {
|
||||
throw "Docker is required but was not found in PATH."
|
||||
}
|
||||
|
||||
docker compose up -d --build traefik redis php1 caddy
|
||||
docker compose up -d --build traefik redis mysql-debug php1 caddy
|
||||
Write-Host "API stack started: http://localhost"
|
||||
|
||||
+1
-1
@@ -14,5 +14,5 @@ if ! command -v docker >/dev/null 2>&1; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker compose up -d --build traefik redis php1 caddy
|
||||
docker compose up -d --build traefik redis mysql-debug php1 caddy
|
||||
echo "API stack started: http://localhost"
|
||||
|
||||
Reference in New Issue
Block a user