Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
node_modules
dist
.git
.github
pics
docs
tests
scripts
types
diagrams
frida-hooks.js
dissector.lua
loader3.py
mock_server.ts
33 changes: 16 additions & 17 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ name: Node.js CI

on:
push:
branches: [ "master" ]
branches: ["master"]
pull_request:
branches: [ "master" ]
branches: ["master"]

jobs:
build:

runs-on: ubuntu-latest

strategy:
Expand All @@ -21,17 +20,17 @@ jobs:
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run tsc
- run: npm run build
- run: npm test
- uses: actions/upload-artifact@v4
with:
name: bundle-${{ matrix.node-version }}
path: dist/bin.cjs
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- run: npm run tsc
- run: npm run build
- run: npm test
- uses: actions/upload-artifact@v4
with:
name: bundle-${{ matrix.node-version }}
path: dist/bin.cjs
6 changes: 1 addition & 5 deletions .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"extensions": ["ts", "js"],
"node-option": [
"experimental-specifier-resolution=node",
"loader=ts-node/esm"
]
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"]
}

37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM node:22-slim AS build

RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY package.json package-lock.json ./
RUN npm ci

COPY . .
RUN npm run build

# ── runtime ──────────────────────────────────────────────
FROM node:22-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
gstreamer1.0-tools \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-bad \
openh264 \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=build /app/dist/bin.cjs ./dist/bin.cjs

RUN useradd -r -s /usr/sbin/nologin cam
USER cam

EXPOSE 8554/udp
EXPOSE 8554/tcp

ENTRYPOINT ["node", "dist/bin.cjs", "rtsp_server"]
CMD ["--discovery_ip", "192.168.1.255"]
Loading
Loading