chore(prod): sync with main #4
@@ -11,4 +11,6 @@ MEDIA_DATA=
|
|||||||
# DB Credentials
|
# DB Credentials
|
||||||
POSTGRES_USER=myuser
|
POSTGRES_USER=myuser
|
||||||
POSTGRES_PASSWORD=mypassword
|
POSTGRES_PASSWORD=mypassword
|
||||||
POSTGRES_DB=vodSystem
|
POSTGRES_DB=vodSystem
|
||||||
|
|
||||||
|
FRONTEND_URL=
|
||||||
@@ -1,10 +1,32 @@
|
|||||||
services:
|
# Local dev: only infrastructure services
|
||||||
rtmp:
|
# Backend and frontend run directly on the host
|
||||||
extends:
|
# Usage: docker compose -f docker-compose.dev.yml up
|
||||||
file: docker-compose.yml
|
|
||||||
service: rtmp
|
|
||||||
|
|
||||||
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
extends:
|
image: postgres:15
|
||||||
file: docker-compose.yml
|
container_name: vod_postgres
|
||||||
service: postgres
|
environment:
|
||||||
|
POSTGRES_USER: ${POSTGRES_USER}
|
||||||
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||||
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
|
volumes:
|
||||||
|
- ${POSTGRES_DATA}:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
|
||||||
|
rtmp:
|
||||||
|
build:
|
||||||
|
context: ./nginx
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
container_name: vod_rtmp
|
||||||
|
extra_hosts:
|
||||||
|
- "host.docker.internal:host-gateway"
|
||||||
|
environment:
|
||||||
|
- WEB_SERVER_URL=http://host.docker.internal:8080
|
||||||
|
ports:
|
||||||
|
- "1935:1935"
|
||||||
|
volumes:
|
||||||
|
- ${STREAM_DATA}:/stream
|
||||||
|
pull_policy: build
|
||||||
|
restart: unless-stopped
|
||||||
@@ -21,7 +21,6 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
FRONTEND_URL: http://localhost:5173
|
|
||||||
SPRING_PROFILES_ACTIVE: dev
|
SPRING_PROFILES_ACTIVE: dev
|
||||||
MEDIA_DATA: /app/data/media
|
MEDIA_DATA: /app/data/media
|
||||||
volumes:
|
volumes:
|
||||||
@@ -49,8 +48,11 @@ services:
|
|||||||
context: ./nginx
|
context: ./nginx
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: vod_rtmp
|
container_name: vod_rtmp
|
||||||
|
environment:
|
||||||
|
- WEB_SERVER_URL=http://backend:8080
|
||||||
ports:
|
ports:
|
||||||
- "1935:1935"
|
- "1935:1935"
|
||||||
volumes:
|
volumes:
|
||||||
- ${STREAM_DATA}:/stream
|
- ${STREAM_DATA}:/stream
|
||||||
|
pull_policy: build
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -16,9 +16,11 @@ rtmp {
|
|||||||
allow play all;
|
allow play all;
|
||||||
|
|
||||||
hls on;
|
hls on;
|
||||||
hls_path /tmp/hls;
|
hls_nested on;
|
||||||
|
hls_path /stream;
|
||||||
|
hls_fragment_naming system;
|
||||||
hls_fragment 3;
|
hls_fragment 3;
|
||||||
hls_playlist_length 60;
|
hls_playlist_length 28800;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -33,7 +35,7 @@ http {
|
|||||||
application/vnd.apple.mpegurl m3u8; # proper MIME for HLS playlists
|
application/vnd.apple.mpegurl m3u8; # proper MIME for HLS playlists
|
||||||
video/mp2t ts; # MPEG-TS segment MIME
|
video/mp2t ts; # MPEG-TS segment MIME
|
||||||
}
|
}
|
||||||
root /tmp;
|
root /stream;
|
||||||
add_header Cache-Control no-cache; # prevent stale segments
|
add_header Cache-Control no-cache; # prevent stale segments
|
||||||
add_header Access-Control-Allow-Origin *; # CORS for browser playback
|
add_header Access-Control-Allow-Origin *; # CORS for browser playback
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user