Browse Source

Add Derpibooru Downloader container.

master
Sasha Wasilewska 10 months ago
parent
commit
f19ccd6204
No known key found for this signature in database GPG Key ID: ADC223901D3524FE
  1. 31
      .github/workflows/derpidl.yml
  2. 2
      derpidl/DerpibooruDownloader.ini
  3. 22
      derpidl/Dockerfile
  4. 8
      derpidl/entrypoint.sh

31
.github/workflows/derpidl.yml

@ -0,0 +1,31 @@
name: "Build Derpibooru Downloader Daily"
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "Setup 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.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: "Build and push Derpibooru Downloader container"
uses: docker/build-push-action@v2
with:
context: ./derpidl
file: ./derpidl/Dockerfile
push: true
tags: |
ghcr.io/innereq/containers/derpidl:latest

2
derpidl/DerpibooruDownloader.ini

@ -0,0 +1,2 @@
[General]
windowGeometry=0

22
derpidl/Dockerfile

@ -0,0 +1,22 @@
FROM alpine:edge AS builder
WORKDIR /opt
RUN apk add --update build-base git qt5-qtbase-dev
RUN git clone --depth=1 --single-branch https://github.com/Sibusten/derpibooru-downloader
WORKDIR /opt/derpibooru-downloader
RUN qmake-qt5
RUN make
FROM alpine:edge
RUN apk add --update --no-cache qt5-qtbase bash
COPY --from=builder /opt/derpibooru-downloader/DerpibooruDownloaderCmd/DerpibooruDownloaderCmd /opt
COPY ./DerpibooruDownloader.ini /opt
COPY ./entrypoint.sh /opt
ENTRYPOINT ["/opt/entrypoint.sh"]
CMD ["/opt/DerpibooruDownloaderCmd"]

8
derpidl/entrypoint.sh

@ -0,0 +1,8 @@
#!/bin/bash
set -e
BOORU_URL_DEFAULT="https://derpibooru.org"
BOORU_FILTER_ID_DEFAULT="56027"
BOORU_OUTPUT_DIR_DEFAULT="/mnt/out/{id}.{ext}"
/opt/DerpibooruDownloaderCmd -a "$BOORU_API_KEY" -b "${BOORU_URL:-$BOORU_URL_DEFAULT}" -f "${BOORU_FILTER_ID:-$BOORU_FILTER_ID_DEFAULT}" -q "$BOORU_QUERY" -I "${BOORU_OUTPUT_DIR:-$BOORU_OUTPUT_DIR_DEFAULT}" "$@"
Loading…
Cancel
Save