Use own Containerfile for traefik-forward-auth
All checks were successful
/ build-keycloak (push) Successful in 47s
/ build-traefik-forward-auth (push) Successful in 1m7s

This commit is contained in:
Finn 2024-08-12 15:19:53 -07:00
parent 69108d154a
commit 747b041721
3 changed files with 15 additions and 7 deletions

View file

@ -4,7 +4,7 @@ on:
- containers/keycloak/* - containers/keycloak/*
- .forgejo/workflows/build-keycloak.yaml - .forgejo/workflows/build-keycloak.yaml
jobs: jobs:
build-synapse: build-keycloak:
runs-on: docker runs-on: docker
container: container:
image: library/docker:dind image: library/docker:dind

View file

@ -1,9 +1,8 @@
on: on:
push: push:
paths: paths:
- containers/traefik-forward-auth/*
- .forgejo/workflows/build-traefik-forward-auth.yaml - .forgejo/workflows/build-traefik-forward-auth.yaml
env:
VERSION: v2.3.0
jobs: jobs:
build-traefik-forward-auth: build-traefik-forward-auth:
runs-on: docker runs-on: docker
@ -11,14 +10,13 @@ jobs:
image: library/docker:dind image: library/docker:dind
steps: steps:
- run: apk add --no-cache nodejs git - run: apk add --no-cache nodejs git
- name: checkout traefik-forward-auth
run: git clone -b ${VERSION} https://github.com/thomseddon/traefik-forward-auth
- name: login to container registry - name: login to container registry
run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login --username ${{ secrets.DEPLOY_USER }} --password-stdin git.janky.solutions run: echo "${{ secrets.DEPLOY_TOKEN }}" | docker login --username ${{ secrets.DEPLOY_USER }} --password-stdin git.janky.solutions
- name: build container image - name: build container image
uses: docker/build-push-action@v4 uses: docker/build-push-action@v4
with: with:
context: traefik-forward-auth/ file: Containerfile
tags: git.janky.solutions/jankysolutions/infra/traefik-forward-auth:${{ env.VERSION }} context: "{{defaultContext}}:containers/traefik-forward-auth"
tags: git.janky.solutions/jankysolutions/infra/traefik-forward-auth:latest
platforms: linux/amd64 platforms: linux/amd64
push: true push: true

View file

@ -0,0 +1,10 @@
FROM library/golang:1.22 as builder
RUN git clone -b v2.3.0 https://github.com/thomseddon/traefik-forward-auth /go/traefik-forward-auth
WORKDIR /go/traefik-forward-auth
RUN CGO_ENABLED=0 go build -a -installsuffix nocgo -o /traefik-forward-auth ./cmd
# Copy into scratch container
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /traefik-forward-auth ./
ENTRYPOINT ["./traefik-forward-auth"]