diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40cd36fe..29fba6f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -87,12 +87,12 @@ jobs: with: name: pigallery2-release path: release - build-docker-amd64arm64: + build-dockerx: runs-on: [ ubuntu-latest ] needs: [ create-release ] strategy: matrix: - container: [ alpine, debian-stretch ] + container: [alpine, debian-buster, debian-bullseye ] steps: - name: Set tag @@ -113,96 +113,44 @@ jobs: with: username: ${{ secrets.REGISTRY_USERNAME }} password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Test build on Pull request and test branches - if: ${{ startsWith(steps.vars.outputs.type , 'head') && ((github.event.issue.pull_request && github.ref == 'refs/heads/master') || github.ref != 'refs/heads/master') }} + - name: Build docker uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64 - - name: Build experimental + platforms: linux/amd64,linux/arm64,linux/arm/v7 + - name: Push experimental if: ${{ github.ref == 'refs/heads/experimental' }} uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: bpatrik/pigallery2:experimental-${{ matrix.container }} - - name: Build and push nightly on new master commit + - name: Push nightly on new master commit if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: bpatrik/pigallery2:nightly-${{ matrix.container }} - - name: Build and push release on new Tag - if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request }} + - name: Push release on new Tag + if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && matrix.container !== 'debian-buster'}} uses: docker/build-push-action@v2 with: context: . file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64 + platforms: linux/amd64,linux/arm64,linux/arm/v7 push: true tags: | bpatrik/pigallery2:nightly-${{ matrix.container }} - bpatrik/pigallery2:${{ steps.vars.outputs.tag}}-${{matrix.container}} - bpatrik/pigallery2:latest-${{matrix.container}} - build-docker-all-platforms: - runs-on: [ ubuntu-latest ] - needs: [ create-release ] - strategy: - matrix: - container: [ debian-buster ] - - steps: - - name: Set tag - id: vars - run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10}) && echo ::set-output name=type::$(echo ${GITHUB_REF:5}) - - name: Checkout - uses: actions/checkout@v2 - - uses: actions/download-artifact@v2 - with: - name: pigallery2-release - path: pigallery2-release - - name: Set up QEMU - uses: docker/setup-qemu-action@v1 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - name: Login to DockerHub - uses: docker/login-action@v1 - with: - username: ${{ secrets.REGISTRY_USERNAME }} - password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Test build on Pull request and test branches - if: ${{ startsWith(steps.vars.outputs.type , 'head') && ((github.event.issue.pull_request && github.ref == 'refs/heads/master') || github.ref != 'refs/heads/master') }} - uses: docker/build-push-action@v2 - with: - context: . - file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64,linux/arm/v7 - - name: Build experimental - if: ${{ github.ref == 'refs/heads/experimental' }} - uses: docker/build-push-action@v2 - with: - context: . - file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: bpatrik/pigallery2:experimental-${{ matrix.container }} - - name: Build and push nightly on new master commit - if: ${{ startsWith(steps.vars.outputs.type , 'head') && !github.event.issue.pull_request && github.ref == 'refs/heads/master' }} - uses: docker/build-push-action@v2 - with: - context: . - file: docker/${{ matrix.container }}/Dockerfile.build - platforms: linux/amd64,linux/arm64,linux/arm/v7 - push: true - tags: bpatrik/pigallery2:nightly-${{ matrix.container }} - - name: Build and push release on new Tag - if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request }} + bpatrik/pigallery2:${{ steps.vars.outputs.tag }}-${{ matrix.container }} + bpatrik/pigallery2:latest-${{ matrix.container }} + - name: Push latest on new Tag + if: ${{ startsWith(steps.vars.outputs.type , 'tag') && !github.event.issue.pull_request && matrix.container === 'debian-buster'}} uses: docker/build-push-action@v2 with: context: . diff --git a/docker/README.md b/docker/README.md index bedd4872..418c71c5 100644 --- a/docker/README.md +++ b/docker/README.md @@ -5,7 +5,7 @@ You can use [docker](https://docs.docker.com/install/) to run PiGallery2. See all available docker tags [here](https://hub.docker.com/r/bpatrik/pigallery2/tags/). available tags: - `v*` (stable): built from the a release with the same version name. - - `latest` (stable): same as the latest `v*`, built with debian stretch + - `latest` (stable): same as the latest `v*`, built with debian buster - `nightly` : built from the current state of `master`. This might break from time to time. **Note**: Some changes may require database reset or config changes, see [#317](https://github.com/bpatrik/pigallery2/issues/317) (If you want to reduce the frequency of those, use stable builds (`latest`) @@ -120,6 +120,6 @@ You do not need the `/sqlite.db` line if you don't ## Build the Docker image on your own -You can clone the repository and build the image, or you can just use the 'self-contained' Dockerfile: [debian-stretch/selfcontained/Dockerfile](debian-stretch/selfcontained/Dockerfile) +You can clone the repository and build the image, or you can just use the 'self-contained' Dockerfile: [debian-buster/selfcontained/Dockerfile](debian-buster/selfcontained/Dockerfile) diff --git a/docker/alpine/Dockerfile.build b/docker/alpine/Dockerfile.build index 6f2ee2f6..3413a11a 100644 --- a/docker/alpine/Dockerfile.build +++ b/docker/alpine/Dockerfile.build @@ -2,7 +2,10 @@ #----------------------------------------- FROM node:14-alpine3.15 AS builder RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.15/community/ \ - python3 build-base sqlite-dev sqlite-libs vips-dev vips fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python + python3 build-base sqlite-dev sqlite-libs fftw-dev gcc g++ make libc6-compat && ln -snf /usr/bin/python3 /usr/bin/python + +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/community/ vips-dev>8.12.2-r3 vips>8.12.2-r3 + COPY pigallery2-release /app WORKDIR /app RUN npm install --unsafe-perm @@ -25,8 +28,10 @@ ENV NODE_ENV=production \ PI_DOCKER=true EXPOSE 80 -RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.15/community/ \ - vips ffmpeg +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/v3.15/community/ ffmpeg +RUN apk add --update-cache --repository https://alpine.global.ssl.fastly.net/alpine/edge/community/ vips>8.12.2-r3 + + COPY --from=builder /app /app VOLUME ["/app/data/config", "/app/data/db", "/app/data/images", "/app/data/tmp"] HEALTHCHECK --interval=40s --timeout=30s --retries=3 --start-period=60s \ diff --git a/docker/debian-stretch/Dockerfile.build b/docker/debian-bullseye/Dockerfile.build similarity index 100% rename from docker/debian-stretch/Dockerfile.build rename to docker/debian-bullseye/Dockerfile.build diff --git a/docker/debian-buster/Dockerfile.build b/docker/debian-buster/Dockerfile.build index f9a6cbc2..852cfef1 100644 --- a/docker/debian-buster/Dockerfile.build +++ b/docker/debian-buster/Dockerfile.build @@ -1,6 +1,6 @@ #-----------------BUILDER----------------- #----------------------------------------- -FROM node:14-buster AS builder +FROM node:14-bullseye AS builder COPY pigallery2-release /app WORKDIR /app RUN npm install --unsafe-perm @@ -12,7 +12,7 @@ RUN mkdir -p /app/data/config && \ #-----------------MAIN-------------------- #----------------------------------------- -FROM node:14-buster-slim AS main +FROM node:14-bullseye-slim AS main WORKDIR /app ENV NODE_ENV=production \ # overrides only the default value of the settings (the actualy value can be overwritten through config.json) diff --git a/docker/debian-stretch/selfcontained/Dockerfile b/docker/debian-buster/selfcontained/Dockerfile similarity index 100% rename from docker/debian-stretch/selfcontained/Dockerfile rename to docker/debian-buster/selfcontained/Dockerfile