fix: replace psql with Python for DB checks (no apt-get needed!)
- Remove postgresql-client installation (causes 150s+ hangs due to network) - Add db_init.py: Pure Python PostgreSQL checks using psycopg2-binary - Simplify startup.sh: Call Python script instead of psql commands - Build should now complete in <30s instead of hanging This fixes the deployment timeout issue by avoiding APT network problems entirely. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
67b00b941e
commit
627eb8e265
3 files changed
+141
-69
No files matched your search
+1
-10
@@ -1,15 +1,6 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Force IPv4 and use German mirror with aggressive retry/timeout settings
|
||||
RUN echo "Acquire::ForceIPv4 \"true\";" > /etc/apt/apt.conf.d/99force-ipv4 && \
|
||||
echo "Acquire::Retries \"5\";" > /etc/apt/apt.conf.d/80-retries && \
|
||||
echo "Acquire::http::Timeout \"10\";" >> /etc/apt/apt.conf.d/80-retries && \
|
||||
echo "Acquire::ftp::Timeout \"10\";" >> /etc/apt/apt.conf.d/80-retries && \
|
||||
echo "deb http://ftp.de.debian.org/debian bookworm main" > /etc/apt/sources.list && \
|
||||
echo "deb http://ftp.de.debian.org/debian bookworm-updates main" >> /etc/apt/sources.list
|
||||
|
||||
# Install PostgreSQL client for psql (needed for startup.sh)
|
||||
RUN apt-get update && apt-get install -y postgresql-client && rm -rf /var/lib/apt/lists/*
|
||||
# No system packages needed - we use Python (psycopg2-binary) for PostgreSQL checks
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
|
||||
Reference in new issue
Block a user