35 lines
1.1 KiB
Docker
35 lines
1.1 KiB
Docker
|
|
# Use Debian-based Node image
|
|
FROM node:lts-bookworm-slim
|
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential cmake git pkg-config \
|
|
libgtk2.0-dev libavcodec-dev libavformat-dev libswscale-dev \
|
|
libtbb-dev libjpeg-dev libpng-dev libtiff-dev \
|
|
ffmpeg ca-certificates \
|
|
python3 python3-dev python3-numpy \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Clone OpenCV and contrib modules
|
|
RUN git clone --branch 4.12.0 https://github.com/opencv/opencv.git /opencv \
|
|
&& git clone --branch 4.12.0 https://github.com/opencv/opencv_contrib.git /opencv_contrib
|
|
|
|
# Build OpenCV with contrib (includes ArUco)
|
|
RUN mkdir /opencv/build && cd /opencv/build \
|
|
&& cmake -D CMAKE_BUILD_TYPE=Release \
|
|
-D CMAKE_INSTALL_PREFIX=/usr/local \
|
|
-D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \
|
|
-D BUILD_opencv_python3=ON \
|
|
-D BUILD_EXAMPLES=OFF .. \
|
|
&& make -j$(nproc) && make install && ldconfig
|
|
|
|
# Set working directory for your Node app
|
|
WORKDIR /usr/src/app
|
|
|
|
# Optional: create non-root user
|
|
# RUN useradd -m -u 1000 nodeuser
|
|
# USER nodeuser
|
|
|
|
# Node dependencies will be installed later via bind mount or COPY
|