commit d73235462277ad579881b1851ac720f6ddd7c155 Author: royalcat Date: Wed Jun 12 01:22:29 2024 +0300 init with discord diff --git a/.forgejo/workflows/image.yaml b/.forgejo/workflows/image.yaml new file mode 100644 index 0000000..71ae509 --- /dev/null +++ b/.forgejo/workflows/image.yaml @@ -0,0 +1,67 @@ +name: docker + +on: + push: + branches: + - master + tags: + - "v*" + +jobs: + build-docker: + permissions: + contents: read + packages: write + strategy: + fail-fast: false + matrix: + platform: + - linux/amd64 + - linux/arm64 + - linux/arm/v7 + - linux/arm64/v8 + + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Container Registry + uses: docker/login-action@v3 + with: + registry: git.kmsign.ru + username: ${{ github.actor }} + password: ${{ secrets.PACKAGE_TOKEN }} + + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Docker meta + id: meta + uses: https://github.com/docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: git.kmsign.ru/${{ github.repository }} + # generate Docker tags based on the following events/attributes + tags: | + type=schedule + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha + + - name: Build and push Docker image + uses: docker/build-push-action@v5 + with: + context: . + push: true + pull: true + platforms: ${{ matrix.platform }} + labels: ${{ steps.meta.outputs.labels }} + sbom: true + provenance: true + cache-from: type=gha + cache-to: type=gha,mode=max + tags: ${{ steps.meta.outputs.tags }} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..1338b62 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +ARG KC_VERSION=25.0.0 + +FROM quay.io/keycloak/keycloak:${KC_VERSION} as builder + +ENV KC_HEALTH_ENABLED=true +ENV KC_METRICS_ENABLED=true +ENV KC_DB=postgres +ENV KC_FEATURES=docker +ENV KC_FEATURES_DISABLED=kerberos,ciba,fips +ENV KC_CACHE=local +ENV KC_PROXY=edge + + + +ADD --chown=keycloak:keycloak --chmod=644 \ + https://github.com/wadahiro/keycloak-discord/releases/download/v0.5.0/keycloak-discord-0.5.0.jar \ + /opt/keycloak/providers/discord.jar + +WORKDIR /opt/keycloak +RUN /opt/keycloak/bin/kc.sh build + +FROM quay.io/keycloak/keycloak:${KC_VERSION} +COPY --from=builder /opt/keycloak/ /opt/keycloak/ + +ENV KC_HEALTH_ENABLED=true +ENV KC_METRICS_ENABLED=true +ENV KC_DB=postgres +ENV KC_FEATURES=docker +ENV KC_FEATURES_DISABLED=kerberos,ciba,fips +ENV KC_CACHE=local +ENV KC_PROXY=edge + +ENTRYPOINT ["/opt/keycloak/bin/kc.sh"] \ No newline at end of file