From 37cce10422b7c23a10676a3666fc26e7742939d0 Mon Sep 17 00:00:00 2001 From: Tony Tran Date: Tue, 5 May 2026 16:29:38 +0700 Subject: [PATCH] fix docker time to GMT+7 --- mediamtx/Dockerfile | 11 +++++++++++ mediamtx/docker-compose.yml | 7 +++++-- mediamtx/mediamtx.yml | 7 +++++-- 3 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 mediamtx/Dockerfile diff --git a/mediamtx/Dockerfile b/mediamtx/Dockerfile new file mode 100644 index 0000000..4f92fc3 --- /dev/null +++ b/mediamtx/Dockerfile @@ -0,0 +1,11 @@ +# Dockerfile +FROM bluenviron/mediamtx:1-ffmpeg + +# Chuyển sang root để cài gói +USER root +RUN apk add --no-cache tzdata && \ + ln -snf /usr/share/zoneinfo/Asia/Ho_Chi_Minh /etc/localtime && \ + echo "Asia/Ho_Chi_Minh" > /etc/timezone + +# Đặt biến môi trường +ENV TZ=Asia/Ho_Chi_Minh diff --git a/mediamtx/docker-compose.yml b/mediamtx/docker-compose.yml index 916556b..93b89e8 100644 --- a/mediamtx/docker-compose.yml +++ b/mediamtx/docker-compose.yml @@ -1,6 +1,9 @@ services: mediamtx: - image: bluenviron/mediamtx:1-ffmpeg + #image: bluenviron/mediamtx:1-ffmpeg + build: . + environment: + - TZ=Asia/Ho_Chi_Minh container_name: mediamtx ports: - 9997:9997/tcp @@ -9,5 +12,5 @@ services: - 8189:8189/udp volumes: - ./mediamtx.yml:/mediamtx.yml - - ./recordings:/recordings + - ./recordings:/recordings restart: unless-stopped diff --git a/mediamtx/mediamtx.yml b/mediamtx/mediamtx.yml index 6bd7ffd..b352565 100644 --- a/mediamtx/mediamtx.yml +++ b/mediamtx/mediamtx.yml @@ -44,8 +44,11 @@ webrtc: true webrtcAddress: :8889 webrtcAllowOrigin: '*' webrtcLocalUDPAddress: :8189 +webrtcLocalTCPAddress: :8189 + webrtcAdditionalHosts: - - 192.168.88.3 + - 192.168.88.5 + - ipcopd.ttcorp.net ############################################ # PLAYBACK (optional - có thể bật sau) @@ -75,7 +78,7 @@ pathDefaults: recordFormat: fmp4 recordPartDuration: 1s recordSegmentDuration: 5m - recordDeleteAfter: 0s # 0s là không tự động xóa, đặt thời gian xóa nếu ổ cứng có giới hạn + recordDeleteAfter: 3600s # 0s là không tự động xóa, đặt thời gian xóa nếu ổ cứng có giới hạn ############################################ # CAMERA PATHS