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
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:
@@ -38,7 +38,7 @@ FROM python:3.12-slim
|
|||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
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/* \
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
&& apt-get clean
|
&& apt-get clean
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
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_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
|
if [ -z "$DB_PORT" ] || [ "$DB_PORT" = "$DB_HOST" ]; then
|
||||||
DB_PORT="5432"
|
DB_PORT="5432"
|
||||||
@@ -25,5 +26,4 @@ done
|
|||||||
|
|
||||||
echo "postgres is ready!"
|
echo "postgres is ready!"
|
||||||
|
|
||||||
# Execute the passed command (supervisord)
|
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user