chore: add local docker validation workflow

This commit is contained in:
2026-05-26 14:48:12 +08:00
parent ef9b8312ec
commit 8d5311c60a
10 changed files with 304 additions and 3 deletions

20
scripts/start-local-docker.sh Executable file
View File

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
cd "$ROOT_DIR"
if [ ! -f deploy/.env.local ]; then
cp deploy/.env.local.example deploy/.env.local
echo "created deploy/.env.local from deploy/.env.local.example"
fi
docker build -f Dockerfile.api -t skg-marketing-local-api:latest .
docker build -f Dockerfile.web -t skg-marketing-local-web:latest --build-arg NEXT_PUBLIC_API_BASE=/api .
docker compose -f docker-compose.local.yml --env-file deploy/.env.local up -d --no-build "$@"
WEB_PORT="$(grep -E '^LOCAL_WEB_PORT=' deploy/.env.local | tail -1 | cut -d= -f2-)"
WEB_PORT="${WEB_PORT:-4390}"
echo "local Docker is starting: http://localhost:${WEB_PORT}"
echo "login: skg / local-skg unless deploy/.env.local overrides it"