setup for docker instead of podman

This commit is contained in:
Micha Albert 2025-01-17 12:39:06 -05:00
parent 7c9c534fb9
commit 7457ecd6f9
No known key found for this signature in database
4 changed files with 23 additions and 34 deletions

View file

@ -1,12 +1,12 @@
live.onboard.hackclub.com { live.onboard.hackclub.com {
reverse_proxy host.containers.internal:8889 reverse_proxy mediamtx:8888
handle /slack/* { handle /slack/* {
reverse_proxy host.containers.internal:8000 reverse_proxy backend:8000
} }
handle /api/v1/github/* { handle /api/v1/github/* {
reverse_proxy host.containers.internal:8000 reverse_proxy backend:8000
} }
handle /auth/* { handle /auth/* {
reverse_proxy host.containers.internal:8000 reverse_proxy backend:8000
} }
} }

View file

@ -1,19 +1,12 @@
services: services:
mediamtx: mediamtx:
restart: unless-stopped restart: unless-stopped
network_mode: "host"
build: build:
context: ./mediamtx context: ./mediamtx
dockerfile: Dockerfile dockerfile: Dockerfile
volumes: volumes:
- mediamtx_recordings:/recordings - mediamtx_recordings:/recordings
# ports:
# - "8889:8889"
# - "1935:1935"
# - "9997:9997"
web-frontend: web-frontend:
ports:
- "4173:4173"
build: build:
context: ./tiling-frontend context: ./tiling-frontend
dockerfile: Dockerfile dockerfile: Dockerfile
@ -24,10 +17,7 @@ services:
resources: resources:
limits: limits:
memory: 8192M memory: 8192M
reservations: shm_size: '6gb'
memory: 8192M
network_mode: "host"
shm_size: '8gb'
restart: unless-stopped restart: unless-stopped
env_file: .stream.env env_file: .stream.env
depends_on: depends_on:
@ -41,7 +31,6 @@ services:
volumes: volumes:
- tiling_frontend_build:/html - tiling_frontend_build:/html
backend: backend:
network_mode: "host"
restart: unless-stopped restart: unless-stopped
env_file: .backend.env env_file: .backend.env
build: build:
@ -50,19 +39,19 @@ services:
volumes: volumes:
- ./backend/db:/usr/src/app/db - ./backend/db:/usr/src/app/db
- mediamtx_recordings:/recordings - mediamtx_recordings:/recordings
caddy: # caddy:
image: docker.io/caddy:alpine # image: docker.io/caddy:alpine
restart: unless-stopped # restart: unless-stopped
cap_add: # cap_add:
- NET_ADMIN # - NET_ADMIN
ports: # ports:
- "80:80" # - "80:80"
- "443:443" # - "443:443"
- "443:443/udp" # - "443:443/udp"
volumes: # volumes:
- $PWD/caddy/Caddyfile:/etc/caddy/Caddyfile # - $PWD/caddy/Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data # - caddy_data:/data
- caddy_config:/config # - caddy_config:/config
volumes: volumes:
mediamtx_recordings: mediamtx_recordings:
tiling_frontend_build: tiling_frontend_build:

View file

@ -20,7 +20,7 @@ bash -c "DISPLAY=:99 xvfb-run \
--window-position=0,0 \ --window-position=0,0 \
--hide-scrollbars \ --hide-scrollbars \
--autoplay-policy=no-user-gesture-required \ --autoplay-policy=no-user-gesture-required \
--app=http://localhost:4173" & disown --app=http://tiling-frontend:4173" & disown
sleep 3 sleep 3

View file

@ -20,7 +20,7 @@
const fetchData = async () => { const fetchData = async () => {
try { try {
const activeStreamResponse = await fetch( const activeStreamResponse = await fetch(
"http://localhost:8000/api/v1/active_stream", "http://backend:8000/api/v1/active_stream",
); );
activeStream = (await activeStreamResponse.text()).replaceAll('"', ""); activeStream = (await activeStreamResponse.text()).replaceAll('"', "");
// if (oldActiveStream !== null && oldActiveStream !== activeStream) { // if (oldActiveStream !== null && oldActiveStream !== activeStream) {
@ -28,7 +28,7 @@
// } // }
oldActiveStream = activeStream; oldActiveStream = activeStream;
const pathListResponse = await ( const pathListResponse = await (
await fetch("http://localhost:9997/v3/paths/list") await fetch("http://mediamtx:9997/v3/paths/list")
).json(); ).json();
console.log(pathListResponse); console.log(pathListResponse);
newData = []; newData = [];
@ -53,7 +53,7 @@
for (const video in videos) { for (const video in videos) {
const hlsInstance = new hls({ backBufferLength: 2 }); const hlsInstance = new hls({ backBufferLength: 2 });
hlsInstance.loadSource( hlsInstance.loadSource(
`http://localhost:8888/${video}/index.m3u8`, `http://mediamtx:8888/${video}/index.m3u8`,
); );
hlsInstance.attachMedia(videos[video]); hlsInstance.attachMedia(videos[video]);
} }