diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 00000000..12cc0382 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,33 @@ +name: Build a Docker image + +# on: +# push: +# branches: +# - 'main' +on: + pull_request: + branches: + - main + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - + name: Set up QEMU + uses: docker/setup-qemu-action@v2 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + - + name: Login to DockerHub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v3 + with: + push: true + tags: whitphx/streamlit-webrtc:latest diff --git a/Dockerfile b/Dockerfile index 266864b7..7b1a2fb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,3 +15,8 @@ ADD poetry.lock /srv/poetry.lock WORKDIR /srv RUN poetry install + +ENV STREAMLIT_SERVER_FILE_WATCHER_TYPE=poll +ENV SHELL=/bin/bash + +EXPOSE 8501 diff --git a/Makefile b/Makefile index f5108fc1..bc1f193a 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,6 @@ docker/run: -it \ -p 8501:8501 \ -v `pwd`:/srv \ - -e STREAMLIT_SERVER_FILE_WATCHER_TYPE=poll \ streamlit-webrtc \ poetry run streamlit run streamlit_app.py @@ -31,7 +30,5 @@ docker/shell: -it \ -p 8501:8501 \ -v `pwd`:/srv \ - -e SHELL=/bin/bash \ - -e STREAMLIT_SERVER_FILE_WATCHER_TYPE=poll \ streamlit-webrtc \ poetry shell