Skip to content

Commit

Permalink
Merge pull request #112 from shopware/add-request-id-caddy-module
Browse files Browse the repository at this point in the history
feat: add request id commit
  • Loading branch information
shyim authored Oct 22, 2024
2 parents ef413dc + e5e5816 commit 800cbdb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 11 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ jobs:

caddy:
name: Build Caddy with ${{ matrix.php }}
runs-on: ubuntu-latest
runs-on: shopware-arm64
container:
image: ghcr.io/catthehacker/ubuntu:act-22.04
needs: [generate-matrix, fpm]
strategy: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
Expand All @@ -120,9 +122,6 @@ jobs:
- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and Push
uses: docker/build-push-action@v6
with:
Expand All @@ -139,22 +138,22 @@ jobs:

caddy-otel:
name: Build Caddy ${{ matrix.php }} with OpenTelemetry
runs-on: ubuntu-latest
runs-on: shopware-arm64
container:
image: ghcr.io/catthehacker/ubuntu:act-22.04
needs: [generate-matrix, fpm-otel]
strategy: ${{ fromJson(needs.generate-matrix.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login into Docker Hub
if: github.ref == 'refs/heads/main'
run: echo "${{ secrets.DOCKER_HUB_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin

- name: Login into Github Docker Registery
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and Push
uses: docker/build-push-action@v6
with:
Expand Down
14 changes: 11 additions & 3 deletions caddy/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@

ARG FPM_IMAGE=ghcr.io/shopware/docker-base:8.3.1-fpm

FROM chainguard/wolfi-base AS caddy-builder

RUN apk add --no-cache go xcaddy caddy-src

ENV CGO_ENABLED=0

RUN xcaddy build --with github.com/caddyserver/caddy/v2=/usr/src/caddy --with github.com/lolPants/caddy-requestid --output /usr/bin/caddy

FROM ${FPM_IMAGE}

USER root

RUN wget -O /etc/apk/keys/wolfi-signing.rsa.pub https://packages.wolfi.dev/os/wolfi-signing.rsa.pub && \
apk add --no-cache --repository https://packages.wolfi.dev/os caddy && \
ln -s /usr/bin/caddy /usr/sbin/caddy && \
COPY --from=caddy-builder /usr/bin/caddy /usr/bin/caddy

RUN ln -s /usr/bin/caddy /usr/sbin/caddy && \
apk add --no-cache supervisor

USER www-data
Expand Down

0 comments on commit 800cbdb

Please sign in to comment.