Docker config
This commit is contained in:
34
Dockerfile.appvideoserver
Normal file
34
Dockerfile.appvideoserver
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
|
||||||
|
# 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
|
||||||
47
docker-compose.yml
Normal file
47
docker-compose.yml
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
version: "3.3"
|
||||||
|
services:
|
||||||
|
|
||||||
|
appvideoserver:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.appvideoserver
|
||||||
|
image: appvideoserver:latest
|
||||||
|
container_name: AppRobotVideo
|
||||||
|
working_dir: /usr/src/app
|
||||||
|
# Mount your host folder into the container
|
||||||
|
volumes:
|
||||||
|
- .:/usr/src/app
|
||||||
|
ports:
|
||||||
|
- "8448:8443"
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
depends_on:
|
||||||
|
- roboticsdriver
|
||||||
|
|
||||||
|
init: true
|
||||||
|
command: >
|
||||||
|
sh -c "
|
||||||
|
if [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then
|
||||||
|
npm ci || npm install
|
||||||
|
else
|
||||||
|
npm install
|
||||||
|
fi
|
||||||
|
&& npm start"
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- HOST_UID=${UID-1000}
|
||||||
|
- HOST_GID=${GID-1000}
|
||||||
|
- DEV0=/dev/video0
|
||||||
|
- DEV1=/dev/video2
|
||||||
|
- TARGET_SERVER=wss://host.docker.internal:2095
|
||||||
|
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
clouds:
|
||||||
|
ipv4_address: 172.20.0.12
|
||||||
|
default:
|
||||||
|
privileged: true
|
||||||
|
cap_add:
|
||||||
|
- SYS_ADMIN
|
||||||
|
security_opt:
|
||||||
|
- seccomp:unconfined
|
||||||
Reference in New Issue
Block a user