Skip to content

Commit

Permalink
http-check
Browse files Browse the repository at this point in the history
  • Loading branch information
gkostin1966 committed Apr 22, 2024
1 parent 4cefbf5 commit 561fe4c
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 20 deletions.
12 changes: 11 additions & 1 deletion apache/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,19 @@ FROM build-base AS packages
COPY ./apache/libapache2 /lauth/apache/libapache2
WORKDIR /lauth/apache/libapache2

# http-check
RUN mkdir -p /lauth/apache/libapache2/http-check/usr/bin
COPY --from=module /lauth/apache/build/http-check /lauth/apache/libapache2/http-check/usr/bin/
RUN ./http-check/DEBIAN/package

# mod-authn-remoteuser
RUN mkdir -p /lauth/apache/libapache2/mod-authn-remoteuser/usr/lib/apache2/modules
COPY --from=module /usr/lib/apache2/modules/mod_authn_remoteuser.so /lauth/apache/libapache2/mod-authn-remoteuser/usr/lib/apache2/modules/
RUN ./mod-authn-remoteuser/DEBIAN/package

# mod-lauth
RUN mkdir -p /lauth/apache/libapache2/mod-lauth/usr/lib/apache2/modules
COPY --from=module /usr/local/include /lauth/apache/libapache2/mod-lauth/usr/include/
COPY --from=module /usr/lib/apache2/modules/mod_lauth.so /lauth/apache/libapache2/mod-lauth/usr/lib/apache2/modules/
RUN ./mod-lauth/DEBIAN/package

Expand All @@ -88,10 +94,12 @@ RUN apt update; \
ca-certificates \
apache2

# install debian packages: http-check, mod-authn-remoteuser, mod-lauth
COPY --from=packages /lauth/apache/libapache2/*.deb /tmp
RUN dpkg -i /tmp/*.deb
RUN rm -f /tmp/*.deb

# enable apache2 modules: lauth, mod-authn-remoteuser
RUN a2enmod lauth
RUN a2enmod authn_remoteuser

Expand All @@ -104,12 +112,14 @@ RUN apt update; \
ca-certificates \
apache2

# install debian packages: http-check, mod-authn-remoteuser, mod-lauth
COPY --from=packages /lauth/apache/libapache2/*.deb /tmp
RUN dpkg -i /tmp/*.deb
RUN rm -f /tmp/*.deb

# enable apache2 modules: lauth, mod-authn-remoteuser
RUN a2enmod lauth
RUN a2enmod authn_remoteuser

# debug
CMD ["sleep", "infinity"]
#CMD ["sleep", "infinity"]
8 changes: 8 additions & 0 deletions apache/libapache2/http-check/DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Package: http-check
Version: 0.0.0
Architecture: arm64
Essential: no
Priority: optional
Depends: apache2
Maintainer: University of Michigan Library Information Technology
Description: Health Check for Apache2
13 changes: 13 additions & 0 deletions apache/libapache2/http-check/DEBIAN/package
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash

# Build Debian Package

# Script directory
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# Parse control file to create package directory name
PACKAGE_DIR=$( cat ${SCRIPT_DIR}/control | awk '$1=="Package:" {print $2} $1=="Version:" {print $2} $1=="Architecture:" {print $2}' | tr '\n' '_' | sed 's/.$//' )

# Build package
mv http-check ${PACKAGE_DIR}
dpkg --build ${PACKAGE_DIR}
3 changes: 0 additions & 3 deletions apache/libapache2/mod-authn-remoteuser/DEBIAN/postinst

This file was deleted.

3 changes: 0 additions & 3 deletions apache/libapache2/mod-authn-remoteuser/DEBIAN/preinst

This file was deleted.

1 change: 1 addition & 0 deletions apache/libapache2/mod-lauth/DEBIAN/postinst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/usr/bin/env bash

# Post-Installation Script
ldconfig
3 changes: 0 additions & 3 deletions apache/libapache2/mod-lauth/DEBIAN/preinst

This file was deleted.

22 changes: 12 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,12 @@ services:
networks:
default:
aliases: ["bullseye"]
# healthcheck:
# test: ["CMD", "http-check", "http://www.lauth.local"]
# interval: "5s"
# timeout: "2s"
# retries: 3
healthcheck:
test: ["CMD", "http-check", "http://www.lauth.local"]
interval: "5s"
timeout: "2s"
retries: 3
command: ["sleep", "infinity"]

bookworm:
profiles: [ "packages" ]
Expand All @@ -150,11 +151,12 @@ services:
networks:
default:
aliases: ["bookworm"]
# healthcheck:
# test: ["CMD", "http-check", "http://www.lauth.local"]
# interval: "5s"
# timeout: "2s"
# retries: 3
healthcheck:
test: ["CMD", "http-check", "http://www.lauth.local"]
interval: "5s"
timeout: "2s"
retries: 3
command: ["sleep", "infinity"]

mock-api:
profiles: [ "test", "integration" ]
Expand Down

0 comments on commit 561fe4c

Please sign in to comment.