diff --git a/.woodpecker/strichliste.yaml b/.woodpecker/strichliste.yaml new file mode 100644 index 0000000..e8711e8 --- /dev/null +++ b/.woodpecker/strichliste.yaml @@ -0,0 +1,25 @@ +when: + - event: push + branch: main + path: + - "strichliste/**" + - ".woodpecker/strichliste.yaml" + - event: tag + ref: "refs/tags/strichliste/*" + +steps: + - name: build + image: quay.io/buildah/stable + commands: + - buildah build --manifest dev.ccchb.de/ccchb/oci-images/strichliste strichliste/ + - buildah manifest push --all dev.ccchb.de/ccchb/oci-images/strichliste oci-archive:/woodpecker/image.tar + privileged: true + - name: push + image: quay.io/skopeo/stable + commands: + - "skopeo copy --dest-creds ccchb:$${FORGEJO_API_TOKEN} oci-archive:/woodpecker/image.tar docker://dev.ccchb.de/ccchb/oci-images/strichliste:$${CI_COMMIT_TAG##strichliste/}" + - "skopeo copy --dest-creds ccchb:$${FORGEJO_API_TOKEN} oci-archive:/woodpecker/image.tar docker://dev.ccchb.de/ccchb/oci-images/strichliste:latest" + secrets: + - FORGEJO_API_TOKEN + when: + event: tag diff --git a/strichliste/Containerfile b/strichliste/Containerfile new file mode 100644 index 0000000..83f4602 --- /dev/null +++ b/strichliste/Containerfile @@ -0,0 +1,18 @@ +FROM alpine AS builder + +WORKDIR /usr/src + +RUN apk update && apk add git + +ADD https://github.com/strichliste/strichliste/releases/download/v1.8.2/strichliste-v1.8.2.tar.gz . +RUN mkdir strichliste/ && tar -xzf strichliste-v1.8.2.tar.gz -C strichliste/ + +FROM docker.io/library/unit:php8.2 + +WORKDIR /var/www/html + +RUN docker-php-ext-install -j$(nproc) mysqli + +COPY --from=builder --chown=unit:unit /usr/src/strichliste . + +COPY config.json /docker-entrypoint.d/config.json diff --git a/strichliste/config.json b/strichliste/config.json new file mode 100644 index 0000000..3115518 --- /dev/null +++ b/strichliste/config.json @@ -0,0 +1,44 @@ +{ + "listeners": { + "*:80": { + "pass": "routes" + } + }, + "routes": [ + { + "match": { + "uri": ["/index.php", "/index.php/*"] + }, + "action": { + "pass": "applications/php_app" + } + }, + { + "match": { + "uri": ["/api", "/api/*"] + }, + "action": { + "rewrite": "/index.php$uri", + "pass": "applications/php_app" + } + }, + { + "match": { + "uri": ["/*"] + }, + "action": { + "share": "/var/www/html/public$uri", + "fallback": { + "rewrite": "/index.php$uri", + "pass": "routes" + } + } + } + ], + "applications": { + "php_app": { + "type": "php", + "root": "/var/www/html/public" + } + } +}