diff --git a/caddy/Caddyfile b/caddy/Caddyfile index 127ced7..59ae856 100644 --- a/caddy/Caddyfile +++ b/caddy/Caddyfile @@ -1,12 +1,12 @@ live.onboard.hackclub.com { - reverse_proxy host.containers.internal:8889 + reverse_proxy mediamtx:8888 handle /slack/* { - reverse_proxy host.containers.internal:8000 + reverse_proxy backend:8000 } handle /api/v1/github/* { - reverse_proxy host.containers.internal:8000 + reverse_proxy backend:8000 } handle /auth/* { - reverse_proxy host.containers.internal:8000 + reverse_proxy backend:8000 } -} \ No newline at end of file +} diff --git a/docker-compose.yml b/docker-compose.yml index 133811c..ad36269 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,19 +1,12 @@ services: mediamtx: restart: unless-stopped - network_mode: "host" build: context: ./mediamtx dockerfile: Dockerfile volumes: - mediamtx_recordings:/recordings - # ports: - # - "8889:8889" - # - "1935:1935" - # - "9997:9997" web-frontend: - ports: - - "4173:4173" build: context: ./tiling-frontend dockerfile: Dockerfile @@ -24,10 +17,7 @@ services: resources: limits: memory: 8192M - reservations: - memory: 8192M - network_mode: "host" - shm_size: '8gb' + shm_size: '6gb' restart: unless-stopped env_file: .stream.env depends_on: @@ -41,7 +31,6 @@ services: volumes: - tiling_frontend_build:/html backend: - network_mode: "host" restart: unless-stopped env_file: .backend.env build: @@ -50,19 +39,19 @@ services: volumes: - ./backend/db:/usr/src/app/db - mediamtx_recordings:/recordings - caddy: - image: docker.io/caddy:alpine - restart: unless-stopped - cap_add: - - NET_ADMIN - ports: - - "80:80" - - "443:443" - - "443:443/udp" - volumes: - - $PWD/caddy/Caddyfile:/etc/caddy/Caddyfile - - caddy_data:/data - - caddy_config:/config + # caddy: + # image: docker.io/caddy:alpine + # restart: unless-stopped + # cap_add: + # - NET_ADMIN + # ports: + # - "80:80" + # - "443:443" + # - "443:443/udp" + # volumes: + # - $PWD/caddy/Caddyfile:/etc/caddy/Caddyfile + # - caddy_data:/data + # - caddy_config:/config volumes: mediamtx_recordings: tiling_frontend_build: diff --git a/live-stream/user_run.sh b/live-stream/user_run.sh index 18e735c..6c8e896 100755 --- a/live-stream/user_run.sh +++ b/live-stream/user_run.sh @@ -20,7 +20,7 @@ bash -c "DISPLAY=:99 xvfb-run \ --window-position=0,0 \ --hide-scrollbars \ --autoplay-policy=no-user-gesture-required \ - --app=http://localhost:4173" & disown + --app=http://tiling-frontend:4173" & disown sleep 3 diff --git a/tiling-frontend/src/App.svelte b/tiling-frontend/src/App.svelte index 9cea327..0df684d 100644 --- a/tiling-frontend/src/App.svelte +++ b/tiling-frontend/src/App.svelte @@ -20,7 +20,7 @@ const fetchData = async () => { try { const activeStreamResponse = await fetch( - "http://localhost:8000/api/v1/active_stream", + "http://backend:8000/api/v1/active_stream", ); activeStream = (await activeStreamResponse.text()).replaceAll('"', ""); // if (oldActiveStream !== null && oldActiveStream !== activeStream) { @@ -28,7 +28,7 @@ // } oldActiveStream = activeStream; const pathListResponse = await ( - await fetch("http://localhost:9997/v3/paths/list") + await fetch("http://mediamtx:9997/v3/paths/list") ).json(); console.log(pathListResponse); newData = []; @@ -53,7 +53,7 @@ for (const video in videos) { const hlsInstance = new hls({ backBufferLength: 2 }); hlsInstance.loadSource( - `http://localhost:8888/${video}/index.m3u8`, + `http://mediamtx:8888/${video}/index.m3u8`, ); hlsInstance.attachMedia(videos[video]); }