Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI/CD to build and push Docker images #935

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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