Internal
Public Access
Update Dockerfile for PostgreSQL support
- Replace MySQL client with PostgreSQL client - Use libpq-dev instead of libmysqlclient-dev - Remove mysqlclient installation (using psycopg2-binary from requirements.txt) - Install postgresql-client for pg_isready health checks 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.5
parent
2afeec85da
commit
a52b09463a
+4
-5
@@ -3,17 +3,16 @@
|
||||
# ===================================================================
|
||||
FROM python:3.12-slim-bookworm AS builder
|
||||
|
||||
# Install build dependencies for mysqlclient and other packages
|
||||
# Install build dependencies for PostgreSQL and other packages
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
gcc \
|
||||
default-libmysqlclient-dev \
|
||||
pkg-config \
|
||||
libpq-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Python dependencies
|
||||
COPY requirements.txt /tmp/
|
||||
RUN pip install --user --no-cache-dir -r /tmp/requirements.txt \
|
||||
&& pip install --user --no-cache-dir mysqlclient gunicorn
|
||||
&& pip install --user --no-cache-dir gunicorn
|
||||
|
||||
# ===================================================================
|
||||
# Stage 2: Runtime - Minimal production image
|
||||
@@ -22,7 +21,7 @@ FROM python:3.12-slim-bookworm
|
||||
|
||||
# Install runtime dependencies only
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
default-mysql-client \
|
||||
postgresql-client \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
Reference in New Issue
Block a user