From 8099932f1f6620174c29379582abe5d83ac064d7 Mon Sep 17 00:00:00 2001 From: vzakharchenko Date: Tue, 11 May 2021 13:24:24 +0300 Subject: [PATCH] Docker image issue - use npm artifact inside docker - fix port map for docker --- Dockerfile | 27 ++++++++------------------- README.md | 6 +++--- local.sh | 2 +- package.json | 12 ++++++------ 4 files changed, 18 insertions(+), 29 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7e915cd..35baa78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,29 +14,18 @@ RUN wget -qO- https://deb.nodesource.com/setup_14.x | bash RUN apt-get update && apt-get install -y ffmpeg yarn nodejs curl RUN npm i pm2 -g # Bundle APP files -RUN mkdir -p /opt/rtsp-samsung-tv/ -COPY package.json /opt/rtsp-samsung-tv/package.json -COPY videoStream.js /opt/rtsp-samsung-tv/videoStream.js -COPY server.js /opt/rtsp-samsung-tv/server.js -COPY mpeg1muxer.js /opt/rtsp-samsung-tv/mpeg1muxer.js -COPY authenticationConnection.js /opt/rtsp-samsung-tv/authenticationConnection.js -COPY index.js /opt/rtsp-samsung-tv/index.js -COPY login /opt/rtsp-samsung-tv/login -RUN mkdir -p /opt/rtsp-samsung-tv/camera-admin-ui -RUN mkdir -p /opt/rtsp-samsung-tv/camera-admin-ui/build -COPY camera-admin-ui/package.json /opt/rtsp-samsung-tv/camera-admin-ui/package.json -COPY camera-admin-ui/public /opt/rtsp-samsung-tv/camera-admin-ui/public -COPY camera-admin-ui/src /opt/rtsp-samsung-tv/camera-admin-ui/src -COPY camera-admin-ui/config-overrides.js /opt/rtsp-samsung-tv/camera-admin-ui/config-overrides.js -RUN cd /opt/rtsp-samsung-tv/ && npm install -RUN cd /opt/rtsp-samsung-tv/camera-admin-ui/ && yarn --network-timeout 100000 -RUN cd /opt/rtsp-samsung-tv/camera-admin-ui/ && yarn install -RUN cd /opt/rtsp-samsung-tv/camera-admin-ui/ && yarn build - +RUN npm i rtsp-samsung-tv@1.1.22 -g # Install app dependencies ENV NPM_CONFIG_LOGLEVEL warn COPY entrypoint.sh /opt/entrypoint.sh RUN chmod +x /opt/entrypoint.sh EXPOSE 3004 +EXPOSE 9999 +EXPOSE 10000 +EXPOSE 10001 +EXPOSE 10002 +EXPOSE 10003 +EXPOSE 10004 + ENTRYPOINT ["/opt/entrypoint.sh"] #CMD [ "pm2-runtime", "start", "pm2.json" ] diff --git a/README.md b/README.md index 524edb6..d45b9dc 100644 --- a/README.md +++ b/README.md @@ -38,17 +38,17 @@ open ```http:\\:3004``` (Default Login: **admin**, Default Password: # Run Inside docker container ``` -docker run -d --name=rtsp-samsung-tv -p 3004:3004 --restart=always vassio/rtsp-samsung-tv:latest +docker run -d --name=rtsp-samsung-tv -p 3004:3004 -p 9999-10004:9999-10004 --restart=always vassio/rtsp-samsung-tv:latest ``` ## Configuration on Host: ``` echo "{}" >/opt/channels.json -docker run -d --name=smartthings-phone-presence-sensor -p 3004:3004 -v /opt/channels.json:/opt/config/channels.json --restart=always vassio/rtsp-samsung-tv:latest +docker run -d --name=rtsp-samsung-tv -p 3004:3004 -p 9999-10004:9999-10004 -v /opt/channels.json:/opt/config/channels.json --restart=always vassio/rtsp-samsung-tv:latest ``` ## Keycloak Protection ``` echo "{}" >/opt/channels.json -docker run -d --name=smartthings-phone-presence-sensor -p 3004:3004 -v /opt/channels.json:/opt/config/channels.json -v `pwd`/keycloak.json:/opt/config/keycloak.json --restart=always vassio/rtsp-samsung-tv:latest +docker run -d --name=rtsp-samsung-tv -p 3004:3004 -p 9999-10004:9999-10004 -v /opt/channels.json:/opt/config/channels.json -v `pwd`/keycloak.json:/opt/config/keycloak.json --restart=always vassio/rtsp-samsung-tv:latest ``` diff --git a/local.sh b/local.sh index e48b6f0..5683efc 100755 --- a/local.sh +++ b/local.sh @@ -3,4 +3,4 @@ docker rm rtsp-samsung-tv # docker image prune -a -f docker build -t rtsp-samsung-tv . -docker run --name=rtsp-samsung-tv -p 3004:3004 -v /home/vzakharchenko/home/rtsp-samsung-tv/config/channels.json:/opt/config/channels.json rtsp-samsung-tv +docker run --name=rtsp-samsung-tv -p 3004:3004 -p 9999-10004:9999-10004 -v /home/vzakharchenko/home/rtsp-samsung-tv/config/channels.json:/opt/config/channels.json rtsp-samsung-tv diff --git a/package.json b/package.json index 265e3aa..db7edb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rtsp-samsung-tv", - "version": "1.1.21", + "version": "1.1.22", "description": "Display RTSP streams from IP Cameras on Samsung smart TV (Tizen TV)", "main": "server.js", "scripts": { @@ -47,22 +47,22 @@ "cron": "^1.8.2", "express": "^4.17.1", "express-session": "^1.17.1", - "keycloak-connect": "^12.0.1", + "keycloak-connect": "^13.0.0", "mkdirp": "^1.0.4", "node-rtsp-stream": "0.0.9", "passport": "^0.4.1", "passport-local": "^1.0.0", - "querystring": "^0.2.0", - "ws": "^7.4.2" + "querystring": "^0.2.1", + "ws": "^7.4.5" }, "devDependencies": { "babel-eslint": "^10.1.0", - "eslint": "^7.18.0", + "eslint": "^7.26.0", "eslint-config": "^0.3.0", "eslint-config-airbnb": "^18.2.1", "eslint-plugin-import": "^2.22.1", "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-react": "^7.22.0" + "eslint-plugin-react": "^7.23.2" }, "bin": { "RtspSamsung": "./bin/RtspSamsungServer"