From 6d5f7b4fd524b09c2a7246505119350a65c12caa Mon Sep 17 00:00:00 2001 From: Izan Gil <66965250+SrIzan10@users.noreply.github.com> Date: Mon, 2 Mar 2026 08:23:46 +0100 Subject: [PATCH] feat(docker): add production docker image for mediatmx --- .github/workflows/docker.yml | 44 +++++++++++++++++--- compose.yml | 4 +- docker/mediamtx/Dockerfile | 8 ++++ mediamtx.yml => docker/mediamtx/mediamtx.yml | 0 4 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 docker/mediamtx/Dockerfile rename mediamtx.yml => docker/mediamtx/mediamtx.yml (100%) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index bd31cf1..8910221 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -10,7 +10,7 @@ jobs: name: Push frontend to Docker Hub runs-on: ubuntu-latest steps: - - name: Wait + - name: Wait uses: NathanFirmo/wait-for-other-action@v1.0.4 with: token: ${{ secrets.GITHUB_TOKEN }} @@ -40,12 +40,12 @@ jobs: RELEASE_URL=$(curl -s https://api.github.com/repos/srizan10/hctv/releases/latest | \ grep "browser_download_url.*slack-import-emojis-linux-x86_64" | \ cut -d '"' -f 4) - + curl -L -o slack-import-emojis-bin $RELEASE_URL chmod +x slack-import-emojis-bin - + mkdir -p apps/web/src/lib/instrumentation/ - + ./slack-import-emojis-bin default cp emojis.json apps/web/ @@ -98,11 +98,43 @@ jobs: secrets: | TURBO_TOKEN=${{ secrets.TURBO_TOKEN }} TURBO_TEAM=${{ secrets.TURBO_TEAM }} + mediamtx: + name: Push MediaMTX image to Docker Hub + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: srizan10/hclive-mediamtx + tags: latest + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: . + file: ./docker/mediamtx/Dockerfile + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64 deploy: name: Deploy to Coolify runs-on: ubuntu-latest - needs: [frontend, chat] + needs: [frontend, chat, mediamtx] steps: - name: Send coolify redeploy webhook run: | - curl -X POST -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" https://coolify.srizan.dev/api/v1/deploy?uuid=${{ secrets.COOLIFY_APP_UUID }}&force=true \ No newline at end of file + curl -X POST -H "Authorization: Bearer ${{ secrets.COOLIFY_API_KEY }}" https://coolify.srizan.dev/api/v1/deploy?uuid=${{ secrets.COOLIFY_APP_UUID }}&force=true diff --git a/compose.yml b/compose.yml index b4bdd21..36a6c12 100644 --- a/compose.yml +++ b/compose.yml @@ -58,8 +58,6 @@ services: volumes: - 'hctv_redis:/data' mediamtx: - image: 'bluenviron/mediamtx:latest' + image: 'srizan10/hclive-mediamtx:latest' ports: - '8890:8890/udp' - volumes: - - './mediamtx.yml:/mediamtx.yml' diff --git a/docker/mediamtx/Dockerfile b/docker/mediamtx/Dockerfile new file mode 100644 index 0000000..649c376 --- /dev/null +++ b/docker/mediamtx/Dockerfile @@ -0,0 +1,8 @@ +FROM bluenviron/mediamtx:1 AS mediamtx + +FROM ubuntu:24.04 + +COPY --from=mediamtx /mediamtx / +COPY ./docker/mediamtx/mediamtx.yml /mediamtx.yml + +ENTRYPOINT ["/mediamtx"] diff --git a/mediamtx.yml b/docker/mediamtx/mediamtx.yml similarity index 100% rename from mediamtx.yml rename to docker/mediamtx/mediamtx.yml