fix: add postgresql-client for pg_isready in entrypoint
Some checks failed
CI / Detect changes (push) Has been cancelled
CI / API Lint (push) Has been cancelled
CI / API Tests (push) Has been cancelled
CI / Scanner Lint (push) Has been cancelled
CI / Scanner Tests (push) Has been cancelled
CI / Banner Lint & Typecheck (push) Has been cancelled
CI / Banner Tests (push) Has been cancelled
CI / Banner Build (push) Has been cancelled
CI / Admin UI Typecheck (push) Has been cancelled
CI / Admin UI Tests (push) Has been cancelled
CI / Admin UI Build (push) Has been cancelled

This commit is contained in:
Ami
2026-04-21 15:57:41 +07:00
parent 51b8e15726
commit 355b5156a5
2 changed files with 4 additions and 4 deletions

View File

@@ -38,7 +38,7 @@ FROM python:3.12-slim
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
libpq5 curl tini supervisor nginx \
libpq5 postgresql-client curl tini supervisor nginx \
&& rm -rf /var/lib/apt/lists/* \
&& apt-get clean

View File

@@ -1,9 +1,10 @@
#!/bin/sh
set -e
# Extract host and port from DATABASE_URL for wait check
# Extract host and port from DATABASE_URL
# Format: postgresql+asyncpg://user:pass@host:port/dbname
DB_HOST=$(echo "$DATABASE_URL" | sed -E 's|.*@([^/:]+).*|\1|')
DB_PORT=$(echo "$DATABASE_URL" | sed -E 's|.*:[0-9]+/([0-9]+).*|\1|' | head -1)
DB_PORT=$(echo "$DATABASE_URL" | sed -E 's|.*@[^/:]+:([0-9]+)/.*|\1|')
if [ -z "$DB_PORT" ] || [ "$DB_PORT" = "$DB_HOST" ]; then
DB_PORT="5432"
@@ -25,5 +26,4 @@ done
echo "postgres is ready!"
# Execute the passed command (supervisord)
exec "$@"