Files
claudecode Bot 751de78f76
node-python image / build (amd64) (push) Successful in 1m11s
node-python image / build (arm64) (push) Successful in 1m6s
node-python image / amend-manifest (push) Successful in 10s
node-python: thêm build-essential (make, g++) cho node-gyp / pip build module native
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.
2026-11-18 08:57:08 +07:00

24 lines
766 B
Docker

FROM node:lts-slim
ENV DEBIAN_FRONTEND=noninteractive
# 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/*
# Tạo virtualenv mặc định cho mọi thứ Python trong container
# => bạn dùng `python`/`pip` là vào venv này luôn
RUN python3 -m venv /opt/venv \
&& /opt/venv/bin/python -m pip install --upgrade pip setuptools wheel
ENV PATH="/opt/venv/bin:${PATH}"
WORKDIR /app