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:
Keith Smith
2025-12-26 16:54:14 -07:00
co-authored by Claude Sonnet 4.5
parent 2afeec85da
commit a52b09463a
+4 -5
View File
@@ -3,17 +3,16 @@
# =================================================================== # ===================================================================
FROM python:3.12-slim-bookworm AS builder 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 \ RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \ gcc \
default-libmysqlclient-dev \ libpq-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install Python dependencies # Install Python dependencies
COPY requirements.txt /tmp/ COPY requirements.txt /tmp/
RUN pip install --user --no-cache-dir -r /tmp/requirements.txt \ 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 # Stage 2: Runtime - Minimal production image
@@ -22,7 +21,7 @@ FROM python:3.12-slim-bookworm
# Install runtime dependencies only # Install runtime dependencies only
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
default-mysql-client \ postgresql-client \
curl \ curl \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*