Actually add healthcheck

This commit is contained in:
Greyscale 2024-01-28 09:20:45 +01:00
parent e12b20b8a3
commit 73c3900f75
No known key found for this signature in database
GPG key ID: 74BAFF55434DA4B2
2 changed files with 18 additions and 5 deletions
.github/workflows
mitm-proxy

View file

@ -20,6 +20,7 @@ jobs:
name: "MITM proxy with Healthchecks"
runs-on: ubuntu-latest
strategy:
fail-fast: false
max-parallel: 15
matrix:
mitmproxy:
@ -69,7 +70,7 @@ jobs:
uses: actions/checkout@v4
with:
sparse-checkout: |
mitmproxy
mitm-proxy
- name: "Setup: Login to Docker Hub"
if: ${{ !env.ACT }}
@ -91,6 +92,10 @@ jobs:
context: mitm-proxy
build-contexts: |
mitmproxy/mitmproxy=docker-image://mitmproxy/mitmproxy:${{ matrix.mitmproxy }}
build-args: |
MITMPROXY_VERSION=${{ matrix.mitmproxy }}
GIT_SHA=${{ github.sha }}
BUILD_DATE=${{ github.event.repository.pushed_at }}
platforms: ${{ (!env.ACT && !(startsWith('6.',matrix.mitmproxy) || startsWith('5.', matrix.mitmproxy))) && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
pull: true
push: true

View file

@ -1,9 +1,17 @@
# From upstream redis
# hadolint ignore=DL3007
FROM mitmproxy/mitmproxy
ARG BUILD_DATE
ARG GIT_SHA
ARG MITM_VERSION
LABEL maintainer="Matthew Baggett <matthew@baggett.me>" \
org.label-schema.vcs-url="https://github.com/benzine-framework/docker" \
org.opencontainers.image.source="https://github.com/benzine-framework/docker"
org.opencontainers.image.source="https://github.com/benzine-framework/docker/mitm-proxy" \
org.opencontainers.image.title="mitm-proxy with healthcheck" \
org.opencontainers.image.created="${BUILD_DATE}" \
org.opencontainers.image.version="${MITM_VERSION}" \
org.opencontainers.image.revision="${GIT_SHA}" \
org.opencontainers.image.vendor="Benzine" \
org.opencontainers.image.authors="Matthew Baggett <matthew@baggett.me>"
# Install curl
# hadolint ignore=DL3018,DL4006
@ -31,5 +39,5 @@ RUN os=$(grep "^ID=" < /etc/os-release | cut -f2 -d'=') && \
fi
# Add healthcheck
#HEALTHCHECK --interval=30s --timeout=3s \
# CMD redis-cli PING
HEALTHCHECK --interval=30s --timeout=3s \
CMD curl -I -x http://localhost:8080 -k https://www.google.com || exit 1