chore: update Dockerfile to install libpq5

- Add libpq5 to the list of installed packages for
  database connections.
- Remove libpq-dev from the list as it is no longer
  necessary for the build process.

These adjustments enhance the Docker image configuration,
ensuring the application can connect to PostgreSQL databases
without unnecessary build dependencies.
This commit is contained in:
songtianlun 2025-01-22 16:57:54 +08:00
parent 853a1d03ce
commit 2ab495897d

View File

@ -16,7 +16,7 @@ WORKDIR /rails
# Install base packages # Install base packages
RUN apt-get update -qq && \ RUN apt-get update -qq && \
apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 && \ apt-get install --no-install-recommends -y curl libjemalloc2 libvips sqlite3 libpq5 && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Set production environment # Set production environment
@ -30,7 +30,7 @@ FROM base AS build
# Install packages needed to build gems and node modules # Install packages needed to build gems and node modules
RUN apt-get update -qq && \ RUN apt-get update -qq && \
apt-get install --no-install-recommends -y build-essential git node-gyp pkg-config python-is-python3 libpq-dev && \ apt-get install --no-install-recommends -y build-essential git node-gyp pkg-config python-is-python3 && \
rm -rf /var/lib/apt/lists /var/cache/apt/archives rm -rf /var/lib/apt/lists /var/cache/apt/archives
# Install JavaScript dependencies # Install JavaScript dependencies