diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index c86b68f..722ace1 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -1,40 +1,47 @@ -name: Docker build and push +name: Build, test and push Docker images on: - push: - branches: - - master - paths-ignore: - - '**.md' - - 'docker-compose.yml' - schedule: - - cron: '0 13 * * 0' - + push: + paths-ignore: + - '**.md' + schedule: + - cron: '0 13 * * 0' jobs: - build: - runs-on: ubuntu-latest + build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 - steps: - - name: checkout code - uses: actions/checkout@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - with: - platforms: all + - name: Set up QEMU + uses: docker/setup-qemu-action@v1 + with: + platforms: all - - name: Set up Docker Buildx - id: buildx - uses: docker/setup-buildx-action@v1 - with: - version: latest + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@v3 + with: + version: latest - - name: Login to docker hub - run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin + - name: Login to docker hub + run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin - - name: build the image - run: | - docker buildx build --push \ - --tag heussd/fivefilters-full-text-rss:latest \ - --platform linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 . + - name: Build amd64 image + run: | + docker buildx bake amd64 --load + - name: Test amd64 image + run: | + docker compose up --no-build --pull never -d + sleep 5s + curl --fail 'http://localhost:80' + curl --fail 'http://localhost:80/makefulltextfeed.php?url=sec%3A%2F%2Fwww.tagesschau.de%2Findex~rss2.xml&max=1&links=preserve' + docker compose down + - name: Build all images + run: | + docker buildx bake + - name: Release images to Dockerhub + if: github.ref == 'refs/heads/master' + run: | + docker buildx bake --push diff --git a/Dockerfile b/Dockerfile index 4b21c24..e60ec13 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,13 +2,13 @@ # Enriches third-party RSS feeds with full text articles # https://bitbucket.org/fivefilters/full-text-rss -FROM heussd/git as gitsrc +FROM alpine/git AS gitsrc WORKDIR /ftr RUN git clone https://bitbucket.org/fivefilters/full-text-rss.git . && \ git reset --hard 384d52fd83361ffd6e7f28bd39b322970a015a28 -FROM heussd/git as gitconfig +FROM alpine/git AS gitconfig WORKDIR /ftr-site-config RUN git clone https://github.com/fivefilters/ftr-site-config . diff --git a/Readme.md b/Readme.md index 1604224..4b291fb 100644 --- a/Readme.md +++ b/Readme.md @@ -8,31 +8,30 @@ This is a containerized version of [fivefilters full-text-rss](https://www.fivef Not affiliated with [fivefilters.org](http://fivefilters.org/). The Dockerfile is licensed under [MIT conditions](LICENSE). - ## User Guide -- Use the following [docker-compose.yml](docker-compose.yml) +- Use the following [compose.yml](compose.yml) ```yaml services: - fullfeedrss: - image: "heussd/fivefilters-full-text-rss:latest" - environment: - # Leave empty to disable admin section - - FTR_ADMIN_PASSWORD= - volumes: - - "rss-cache:/var/www/html/cache/rss" - ports: - - "80:80" + fullfeedrss: + image: 'heussd/fivefilters-full-text-rss:latest' + environment: + # Leave empty to disable admin section + - FTR_ADMIN_PASSWORD= + volumes: + - 'rss-cache:/var/www/html/cache/rss' + ports: + - '80:80' volumes: - rss-cache: + rss-cache: ``` -- Start it with `docker-compose up` -- Visit [http://localhost:80](http://localhost:80) for the integrated web UI +- Start it with `docker-compose up` +- Visit [http://localhost:80](http://localhost:80) for the integrated web UI ![](webui.png) -- Interesting endpoints (see tab [Request & Response](http://localhost/#request)): - - Article extraction: `http://localhost/extract.php?url=[url]` - - Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]` +- Interesting endpoints (see tab [Request & Response](http://localhost/#request)): + - Article extraction: `http://localhost/extract.php?url=[url]` + - Feed conversion: `http://localhost/makefulltextfeed.php?url=[url]` diff --git a/docker-compose.yml b/compose.yml similarity index 100% rename from docker-compose.yml rename to compose.yml diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000..f101b43 --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,17 @@ +variable "IMAGE" { + default = "heussd/fivefilters-full-text-rss:latest" +} + +group "default" { + targets = ["all"] +} + +target "all" { + tags = ["${IMAGE}"] + platforms = ["linux/amd64", "linux/arm64", "linux/arm/v7", "linux/arm/v6"] +} + +target "amd64" { + tags = ["${IMAGE}"] + platforms = ["linux/amd64"] +} diff --git a/docker-compose.override.yml b/docker-compose.override.yml deleted file mode 100644 index 561e566..0000000 --- a/docker-compose.override.yml +++ /dev/null @@ -1,3 +0,0 @@ -services: - fullfeedrss: - build: .