fix docker time to GMT+7

This commit is contained in:
2026-05-05 16:29:38 +07:00
parent 16c35803a7
commit 37cce10422
3 changed files with 21 additions and 4 deletions
+11
View File
@@ -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
+5 -2
View File
@@ -1,6 +1,9 @@
services: services:
mediamtx: mediamtx:
image: bluenviron/mediamtx:1-ffmpeg #image: bluenviron/mediamtx:1-ffmpeg
build: .
environment:
- TZ=Asia/Ho_Chi_Minh
container_name: mediamtx container_name: mediamtx
ports: ports:
- 9997:9997/tcp - 9997:9997/tcp
@@ -9,5 +12,5 @@ services:
- 8189:8189/udp - 8189:8189/udp
volumes: volumes:
- ./mediamtx.yml:/mediamtx.yml - ./mediamtx.yml:/mediamtx.yml
- ./recordings:/recordings - ./recordings:/recordings
restart: unless-stopped restart: unless-stopped
+5 -2
View File
@@ -44,8 +44,11 @@ webrtc: true
webrtcAddress: :8889 webrtcAddress: :8889
webrtcAllowOrigin: '*' webrtcAllowOrigin: '*'
webrtcLocalUDPAddress: :8189 webrtcLocalUDPAddress: :8189
webrtcLocalTCPAddress: :8189
webrtcAdditionalHosts: webrtcAdditionalHosts:
- 192.168.88.3 - 192.168.88.5
- ipcopd.ttcorp.net
############################################ ############################################
# PLAYBACK (optional - có thể bật sau) # PLAYBACK (optional - có thể bật sau)
@@ -75,7 +78,7 @@ pathDefaults:
recordFormat: fmp4 recordFormat: fmp4
recordPartDuration: 1s recordPartDuration: 1s
recordSegmentDuration: 5m 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 # CAMERA PATHS