diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 5ab8acf..9ffc325 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -45,6 +45,10 @@ jobs: with: cosign-release: 'v2.1.1' + # Set up QEMU for cross-platform builds + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + # Set up BuildKit Docker container builder to be able to build # multi-platform images and export cache # https://github.com/docker/setup-buildx-action @@ -106,6 +110,7 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64,linux/arm64 tags: | ${{ steps.meta.outputs.tags }} ${{ steps.meta_dockerhub.outputs.tags }} @@ -121,6 +126,7 @@ jobs: with: context: . push: ${{ github.event_name != 'pull_request' }} + platforms: linux/amd64,linux/arm64 tags: | ${{ steps.meta-full.outputs.tags }} ${{ steps.meta_dockerhub-full.outputs.tags }} diff --git a/Dockerfile b/Dockerfile index 951fe49..13d22f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,22 +3,18 @@ ARG BUILDTYPE=minimal FROM debian:12-slim AS build-venv RUN apt-get update && \ - apt-get install --no-install-suggests --no-install-recommends --yes xz-utils python3 python3-venv && \ + apt-get install --no-install-suggests --no-install-recommends --yes gcc python3-dev python3 python3-venv && \ apt-get clean && \ python3 -m venv /venv && \ /venv/bin/pip install --upgrade pip -ADD https://github.com/eugeneware/ffmpeg-static/releases/download/b6.0/ffmpeg-linux-x64 /usr/bin/ffmpeg -ADD https://www.7-zip.org/a/7z2301-linux-x64.tar.xz /tmp/ -RUN tar -C /usr/bin -xvf /tmp/7z*.tar.xz 7zz COPY . /tmp/comiclib RUN /venv/bin/pip install --no-cache-dir -U "/tmp/comiclib[full]" RUN /venv/bin/pip install --no-cache-dir -U gunicorn RUN mkdir /userdata -FROM debian:12-slim AS data +FROM quay.io/karuboniru/7zz:2301 AS data ADD https://files.niconi.org/api_dump.sqlite.7z /tmp -COPY --from=build-venv /usr/bin/7zz /usr/bin RUN mkdir /exract WORKDIR /extract RUN 7zz x /tmp/api_dump.sqlite.7z @@ -33,9 +29,12 @@ ENV importEHdb_database_URI=file:api_dump.sqlite?mode=rw FROM product-env-${BUILDTYPE} COPY --from=build-venv /venv /venv -COPY --from=build-venv /usr/bin/7zz /usr/bin -COPY --from=build-venv /usr/bin/ffmpeg /usr/bin COPY --from=build-venv /userdata /userdata +COPY --from=quay.io/karuboniru/7zz:2301 \ + /usr/local/bin/7zz /usr/bin +COPY --from=docker.io/mwader/static-ffmpeg:latest \ + /ffmpeg /usr/bin + ENV content=/root/comiclib watch=False EXPOSE 8000 WORKDIR /userdata