From 751de78f761ddaf3b1cb3255f30ac4b5ceae0789 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 08:57:08 +0700 Subject: [PATCH] =?UTF-8?q?node-python:=20th=C3=AAm=20build-essential=20(m?= =?UTF-8?q?ake,=20g++)=20cho=20node-gyp=20/=20pip=20build=20module=20nativ?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Image node-python có python3 nhưng thiếu make/g++, nên module Node có phần native (vd better-sqlite3) không biên dịch được khi không tải được prebuilt. Đã thử: docker build OK; trong image, npm ci của tl-noti build better-sqlite3 từ nguồn thành công, 55/55 test pass. --- README.md | 3 ++- node-python/Dockerfile | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 427759e..880aa1f 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,8 @@ Kho lưu trữ này cung cấp các Docker base image cho nhiều mục đích s - Các gói/phần mềm đã cài đặt: - **Node.js** kèm theo **npm** và **yarn** - **git** - - **python v3.11** + - **python v3** + - **build-essential** (make, g++) — cho node-gyp / pip build module native - **node-go** - `git.thuanle.me/public/node-go:latest` diff --git a/node-python/Dockerfile b/node-python/Dockerfile index f22c0e2..087cea2 100644 --- a/node-python/Dockerfile +++ b/node-python/Dockerfile @@ -2,11 +2,14 @@ FROM node:lts-slim ENV DEBIAN_FRONTEND=noninteractive -# Cài git + Python 3.11 (Debian stable) +# Cài git + Python 3 (Debian stable) + build-essential (make, g++): +# node-gyp (module Node có phần native, vd better-sqlite3) và pip build wheel C +# cần trình biên dịch khi không tải được bản build sẵn. RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends \ git \ + build-essential \ python3 python3-pip python3-venv; \ rm -rf /var/lib/apt/lists/* -- 2.54.1