fix(infra): wait for postgres readiness before running migrations on container start

Installs postgresql-client in the dev image so pg_isready is available.
The startup script now polls until postgres accepts connections, preventing
the P1001 "can't reach database" crash when the app container starts before
postgres is fully ready.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-09 21:14:31 +02:00
parent 43de66e982
commit c784b4b378
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
FROM node:20-bookworm-slim AS base
# Prisma needs OpenSSL available during install/generate/runtime.
RUN apt-get update -y && apt-get install -y openssl && rm -rf /var/lib/apt/lists/*
RUN apt-get update -y && apt-get install -y openssl postgresql-client && rm -rf /var/lib/apt/lists/*
# Install pnpm
RUN npm install -g pnpm@9.14.2