diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..5a534de --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,38 @@ +name: Publish Docker image + +on: + push: + branches: + - 'master' + schedule: + - cron: 0 0 * * 0 # Weekly + workflow_dispatch: + +jobs: + push_to_registry: + name: Push docker image to registry + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to ghcr + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: ghcr.io/${{ github.actor }}/streamonitor:latest + diff --git a/Dockerfile b/Dockerfile index 4b26ac5..2b0f63a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,9 @@ # syntax=docker/dockerfile:1 -FROM python:3.10-slim-buster +FROM python:3.12-alpine3.19 -RUN \ - # Install additional dependencies - apt update && \ - apt install -y ffmpeg && \ - rm -rf /var/cache/apt/lists ; +# Install dependencies +RUN apk add --no-cache ffmpeg WORKDIR /app diff --git a/docker-compose.yml b/docker-compose.yml index 22e1810..e9cae13 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,3 +10,4 @@ services: - ./parameters.py:/app/parameters.py ports: - '6969:6969' + - '5000:5000' diff --git a/streamonitor/managers/httpmanager.py b/streamonitor/managers/httpmanager.py index 7683228..ed0807f 100644 --- a/streamonitor/managers/httpmanager.py +++ b/streamonitor/managers/httpmanager.py @@ -60,4 +60,4 @@ def recordings(): output += "

No recordings

" return output - app.run(host='127.0.0.1', port=5000) + app.run(host='0.0.0.0', port=5000)