chore: update Dockerfile and package dependencies for pg-native support

- Added build dependencies for native Node.js modules in the Dockerfile, including python3, make, g++, and postgresql-dev.
- Installed postgresql-libs and removed build dependencies after installation to reduce image size.
- Updated pnpm-lock.yaml to include pg-native version 3.5.2 and adjusted related package versions accordingly.
- Modified package.json to add pg-native as a dependency.
- Updated vite.config.ts to include pg-native in the external dependencies list.

Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
Innei
2025-12-05 16:39:27 +08:00
parent 51df233429
commit 5984ca407e
4 changed files with 67 additions and 15 deletions

View File

@@ -37,6 +37,10 @@ WORKDIR /app
# - perl-image-exiftool: provides the exiftool binary
# - vips: runtime library for sharp
# - libheif: enable HEIF/HEIC support in libvips when available
# Build deps for native modules (pg-native/libpq):
# - python3, make, g++: required to build native Node.js modules
# - postgresql-dev: provides libpq headers and runtime library for pg-native
# - postgresql-libs: runtime library for libpq (kept after build)
RUN apk add --no-cache \
curl \
perl \
@@ -46,6 +50,12 @@ RUN apk add --no-cache \
libheif \
libc6-compat \
gcompat \
postgresql-libs \
&& apk add --no-cache --virtual .build-deps \
python3 \
make \
g++ \
postgresql-dev \
&& EXIFTOOL_BIN="$(command -v exiftool)" \
&& echo "Using exiftool binary at ${EXIFTOOL_BIN}" \
&& "${EXIFTOOL_BIN}" -ver \
@@ -64,6 +74,9 @@ RUN if [ -f dist/package.json ]; then \
npm install --omit=dev --no-audit --no-fund; \
fi
# Remove build tools after native modules are built to reduce image size
RUN apk del .build-deps
EXPOSE 1841
ENTRYPOINT ["./docker-entrypoint.sh"]