komga/run-local-with-postgres.sh
duong.doan1 29692c738b feat: Complete Sprint 1 PostgreSQL infrastructure
- Add flyway-database-postgresql dependency
- Create DatabaseUdfProvider abstraction with SQLite/PostgreSQL implementations
- Update all DAO classes to use JooqUdfHelper for database-agnostic UDF/collation
- Implement dynamic JOOQ dialect configuration based on database type
- Add PostgreSQL migration directory with initial migration
- Create Docker Compose setup for PostgreSQL 16
- Add integration test with Testcontainers PostgreSQL
- Create helper scripts for local testing
- Update application.yml for simplified testing
- Add documentation and task tracking
2026-04-07 14:09:19 +07:00

27 lines
No EOL
718 B
Bash
Executable file

#!/bin/bash
# Script to run Komga locally with PostgreSQL
set -e
echo "Starting PostgreSQL container..."
docker-compose up -d postgres
echo "Waiting for PostgreSQL to be ready..."
sleep 5
echo "Building Komga..."
./gradlew :komga:build -x test
echo "Running Komga with PostgreSQL..."
SPRING_PROFILES_ACTIVE=docker \
KOMGA_DATABASE_TYPE=postgresql \
KOMGA_DATABASE_URL="jdbc:postgresql://localhost:5433/komga?sslmode=disable&socketTimeout=10" \
KOMGA_DATABASE_USERNAME=komga \
KOMGA_DATABASE_PASSWORD=komga123 \
KOMGA_CONFIG_DIR="$HOME/.komga-postgres" \
./gradlew :komga:bootRun
echo "Komga is running at http://localhost:25600"
echo "PostgreSQL is running at localhost:5433"
echo "To stop: docker-compose down"