Merge pull request #5 from shymega/shymega/prs/docker

Add Docker support for RSSingle, and a workflow for builds
This commit is contained in:
Andros Fenollosa 2023-12-29 11:53:56 +01:00 committed by GitHub
commit cfd6bddafc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 67 additions and 0 deletions

5
.dockerignore Normal file
View File

@ -0,0 +1,5 @@
/LICENSE
/README.md
/rssingle.png
/Dockerfile
/config.yml

44
.github/workflows/container.yml vendored Normal file
View File

@ -0,0 +1,44 @@
name: Container image builder for RSS single
on:
workflow_run:
workflows: ["CI workflow for RSSingle"]
types: [completed]
branches: [master]
jobs:
build-and-push-container-image:
name: Build and push container image to Docker Hub and GHCR.io
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v2
- name: Build container image
id: build
uses: redhat-actions/buildah-build@v2
with:
image: tanrax/rssingle
tags: latest
containerfiles: Dockerfile
- name: Push container image to Docker Hub
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: docker.io
username: tanrax
password: ${{ secrets.DOCKER_TOKEN }}
- name: Push container image to GHCR.io
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build.outputs.image }}
tags: ${{ steps.build.outputs.tags }}
registry: ghcr.io
username: tanrax
password: ${{ secrets.GITHUB_TOKEN }}

18
Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM docker.io/python:3.8-buster AS base
FROM base AS build
WORKDIR /work
COPY . .
RUN pip3 install pyinstaller
RUN pip3 install -r /work/requirements.txt
RUN pyinstaller --onefile /work/rssingle.py
FROM docker.io/python:3.8-buster AS app
COPY --from=build /work/dist/rssingle /rssingle
ENTRYPOINT ["/rssingle"]