Skip to content

Commit

Permalink
Github action to build and upload the image to ghcr (#20)
Browse files Browse the repository at this point in the history
* Add workflow to build and push container image
* Fix Dockerfile. Copy /app files from host to docker image
* Fix Dockerfile. rename in Dockerfile App.py to app.py
* Add Label into Dockerfile.
  • Loading branch information
luisalrp authored Nov 2, 2023
1 parent fea8224 commit 590eead
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/container-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Push Container Image

on:
push:
branches:
- main

jobs:
build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/arxivchatguru:${{ github.ref == 'refs/heads/main' && 'latest' || 'canary' }}
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ RUN apt-get update && apt-get install python-tk python3-tk tk-dev -y

WORKDIR /app

COPY ./app/requirements.txt .
# Copy all files and subdirectories from ./app to /app in the image
COPY ./app /app

RUN pip install -r requirements.txt

CMD ["streamlit", "run", "App.py", "--server.fileWatcherType", "none", "--browser.gatherUsageStats", "false","--server.enableXsrfProtection", "false", "--server.address", "0.0.0.0"]
LABEL org.opencontainers.image.source https://github.com/RedisVentures/ArxivChatGuru

CMD ["streamlit", "run", "app.py", "--server.fileWatcherType", "none", "--browser.gatherUsageStats", "false","--server.enableXsrfProtection", "false", "--server.address", "0.0.0.0"]

0 comments on commit 590eead

Please sign in to comment.