Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
VT2 Видеотехнологии
ONVIF-PTZ proxy
Commits
7dd8c4e5
Commit
7dd8c4e5
authored
1 year ago
by
Mikhail Sennikov
Browse files
Options
Download
Patches
Plain Diff
docker-compose
parent
222accc6
main
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
Backend/config.py
+0
-3
Backend/config.py
Dockerfiles/Dockerfile
+8
-7
Dockerfiles/Dockerfile
ProxyNode/config.py
+3
-1
ProxyNode/config.py
ProxyNode/rtsp/rtsp_placeholder.py
+3
-1
ProxyNode/rtsp/rtsp_placeholder.py
docker-compose.yml
+71
-14
docker-compose.yml
with
85 additions
and
26 deletions
+85
-26
Backend/config.py
+
0
−
3
View file @
7dd8c4e5
...
@@ -5,9 +5,6 @@ credentials = {
...
@@ -5,9 +5,6 @@ credentials = {
# Does not change server settings, used only for data substitution
# Does not change server settings, used only for data substitution
server
=
{
server
=
{
'host'
:
'192.168.1.106'
,
'port'
:
8080
,
'rtsp_port'
:
8554
,
'login_service_host'
:
'localhost'
,
'login_service_host'
:
'localhost'
,
'login_service_port'
:
8082
,
'login_service_port'
:
8082
,
}
}
...
...
This diff is collapsed.
Click to expand it.
Dockerfiles/Dockerfile
+
8
−
7
View file @
7dd8c4e5
...
@@ -2,13 +2,14 @@ FROM python:3.11-alpine
...
@@ -2,13 +2,14 @@ FROM python:3.11-alpine
LABEL
authors="Mikhail Sennikov"
LABEL
authors="Mikhail Sennikov"
RUN
apk add
--no-cache
ffmpeg
RUN
apk add
--no-cache
ffmpeg
RUN
pip3
install
aiohttp fastapi lxml onvif-zeep-async uvicorn
RUN
pip3
install
aiohttp fastapi lxml onvif-zeep-async
\
uvicorn SQLAlchemy psycopg2 asyncpg bcrypt pytz
COPY
Backend /ptz-proxy
COPY
ProxyNode/rtsp/mediamtx.yml
WORKDIR
/ptz-proxy/rtsp
ProxyNode/rtsp/download_mediamtx.sh
RUN
/ptz-proxy/rtsp/download_
mediamtx
.sh
/
mediamtx
/
WORKDIR
/mediamtx
RUN
mkdir
-p
/ptz-proxy/frontend
RUN
/mediamtx/download_mediamtx.sh
WORKDIR
/ptz-proxy
WORKDIR
/ptz-proxy
CMD
["python", "
-m", "uvicorn", "main:app", "--reload", "--host", "0.0.0.0", "--port", "9000
"]
CMD
["python", "
run.py
"]
This diff is collapsed.
Click to expand it.
ProxyNode/config.py
+
3
−
1
View file @
7dd8c4e5
...
@@ -8,7 +8,7 @@ port = int(os.getenv("NODE_PORT", 8081))
...
@@ -8,7 +8,7 @@ port = int(os.getenv("NODE_PORT", 8081))
database
=
{
database
=
{
'driver'
:
"postgresql+asyncpg"
,
'driver'
:
"postgresql+asyncpg"
,
'host'
:
"
localhost
"
,
'host'
:
"
postgres
"
,
'port'
:
5432
,
'port'
:
5432
,
'database'
:
"postgres"
,
'database'
:
"postgres"
,
'user'
:
"postgres"
,
'user'
:
"postgres"
,
...
@@ -28,3 +28,5 @@ services_to_proxy = {
...
@@ -28,3 +28,5 @@ services_to_proxy = {
# 'Search',
# 'Search',
# 'Replay'
# 'Replay'
}
}
mediamtx_path
=
"/mediamtx/mediamtx"
This diff is collapsed.
Click to expand it.
ProxyNode/rtsp/rtsp_placeholder.py
+
3
−
1
View file @
7dd8c4e5
...
@@ -2,6 +2,8 @@ import asyncio
...
@@ -2,6 +2,8 @@ import asyncio
import
subprocess
import
subprocess
from
asyncio
import
Task
from
asyncio
import
Task
import
config
async
def
start_rtsp_server
():
async
def
start_rtsp_server
():
ffmpeg
=
None
ffmpeg
=
None
...
@@ -11,7 +13,7 @@ async def start_rtsp_server():
...
@@ -11,7 +13,7 @@ async def start_rtsp_server():
mediamtx
=
asyncio
.
create_task
(
mediamtx
=
asyncio
.
create_task
(
start_service
(
start_service
(
"MediaMTX"
,
"MediaMTX"
,
[
"rtsp/
mediamtx
"
,
"rtsp/mediamtx.yml"
]
[
config
.
mediamtx
_path
,
"rtsp/mediamtx.yml"
]
)
)
)
)
await
asyncio
.
sleep
(
3
)
await
asyncio
.
sleep
(
3
)
...
...
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
71
−
14
View file @
7dd8c4e5
version
:
'
3.8'
version
:
'
3.8'
services
:
services
:
ptx-proxy
:
postgres
:
image
:
postgres
environment
:
POSTGRES_DB
:
"
postgres"
POSTGRES_USER
:
"
postgres"
POSTGRES_PASSWORD
:
"
password"
ptz-proxy-master
:
build
:
build
:
context
:
.
context
:
.
dockerfile
:
Dockerfiles/Dockerfile
dockerfile
:
Dockerfiles/Dockerfile
volumes
:
volumes
:
-
./Backend/config.py:/ptz-proxy/config.py:ro
-
./Backend:/ptz-proxy:ro
-
./Frontend/dist:/ptz-proxy/frontend:ro
ports
:
ports
:
-
"
0.0.0.0:8080:9000"
-
"
0.0.0.0:8080:8080"
-
"
0.0.0.0:8554:8554"
depends_on
:
postgres
:
condition
:
service_started
ptz-proxy-node-1
:
build
:
context
:
.
dockerfile
:
Dockerfiles/Dockerfile
volumes
:
-
./ProxyNode:/ptz-proxy:ro
ports
:
-
"
0.0.0.0:8081:8081"
-
"
0.0.0.0:8551:8554"
depends_on
:
ptz-proxy-master
:
condition
:
service_started
ptz-proxy-node-2
:
build
:
context
:
.
dockerfile
:
Dockerfiles/Dockerfile
volumes
:
-
./ProxyNode:/ptz-proxy:ro
ports
:
-
"
0.0.0.0:8083:8081"
-
"
0.0.0.0:8553:8554"
depends_on
:
depends_on
:
frontend-build
er
:
ptz-proxy-mast
er
:
condition
:
service_
completed_successfully
condition
:
service_
started
frontend-builder
:
ptz-proxy-node-3
:
image
:
node:alpine
build
:
context
:
.
dockerfile
:
Dockerfiles/Dockerfile
volumes
:
volumes
:
-
./Frontend:/ptz-proxy/frontend:rw
-
./ProxyNode:/ptz-proxy:ro
working_dir
:
/ptz-proxy/frontend
ports
:
command
:
>
-
"
0.0.0.0:8083:8081"
/bin/sh -c
-
"
0.0.0.0:8553:8554"
"npm install && npm run build && npm prune --production"
depends_on
:
ptz-proxy-master
:
condition
:
service_started
ptz-proxy-node-4
:
build
:
context
:
.
dockerfile
:
Dockerfiles/Dockerfile
volumes
:
-
./ProxyNode:/ptz-proxy:ro
ports
:
-
"
0.0.0.0:8084:8081"
-
"
0.0.0.0:8554:8554"
depends_on
:
ptz-proxy-master
:
condition
:
service_started
# frontend-builder:
# image: node:alpine
# volumes:
# - ./Frontend:/ptz-proxy/frontend:rw
# working_dir: /ptz-proxy/frontend
# command: >
# /bin/sh -c
# "npm install && npm run build && npm prune --production"
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets