From e31b7b3e6008ee380b672517d4d7c90f68286d07 Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 17:11:03 +0200 Subject: [PATCH 1/8] use alpine for webserver --- Dockerfile | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5ff8fb6..6020980 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,32 +14,29 @@ COPY --from=buildJS /build /build RUN cd /build/public/API && composer install # Prepare Webserver -FROM php:8-apache-buster +FROM httpd:alpine # |-------------------------------------------------------------------------- -# | install php extensions +# | install dependencies # |-------------------------------------------------------------------------- -RUN docker-php-ext-install mysqli - -# |-------------------------------------------------------------------------- -# | enable production php ini -# |-------------------------------------------------------------------------- -RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" +RUN apk update && \ + apk upgrade && \ + apk add php8-apache2 php8-mysqli curl # |-------------------------------------------------------------------------- # | copy website from node build # |-------------------------------------------------------------------------- -COPY --from=composer /build/public /var/www/html +COPY --from=composer /build/public /usr/local/apache2/htdocs/ # |-------------------------------------------------------------------------- # | enable apache modules # |-------------------------------------------------------------------------- -RUN a2enmod headers rewrite +RUN sed -i '/LoadModule rewrite_module/s/^#//g' /usr/local/apache2/conf/httpd.conf && \ + sed -i 's#AllowOverride [Nn]one#AllowOverride All#' /usr/local/apache2/conf/httpd.conf # |-------------------------------------------------------------------------- -# | enable metrics +# | enable healthcheck # |-------------------------------------------------------------------------- -RUN apt update && apt install curl HEALTHCHECK CMD curl --fail http://localhost || exit 1 # |-------------------------------------------------------------------------- From 50fc8010b7de4f0f2bf6f1ec541881bfa7781962 Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:05:50 +0200 Subject: [PATCH 2/8] manual install apache --- Dockerfile | 10 ++++++++-- httpd-foreground | 7 +++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 httpd-foreground diff --git a/Dockerfile b/Dockerfile index 6020980..a1410f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,14 +14,14 @@ COPY --from=buildJS /build /build RUN cd /build/public/API && composer install # Prepare Webserver -FROM httpd:alpine +FROM alpine:alpine # |-------------------------------------------------------------------------- # | install dependencies # |-------------------------------------------------------------------------- RUN apk update && \ apk upgrade && \ - apk add php8-apache2 php8-mysqli curl + apk add apache2 php8-apache2 php8-mysqli curl # |-------------------------------------------------------------------------- # | copy website from node build @@ -43,3 +43,9 @@ HEALTHCHECK CMD curl --fail http://localhost || exit 1 # | expose http port # |-------------------------------------------------------------------------- EXPOSE 80 + +# |-------------------------------------------------------------------------- +# | set entrypoint +# |-------------------------------------------------------------------------- +COPY httpd-foreground /usr/local/bin/ +CMD ["httpd-foreground"] \ No newline at end of file diff --git a/httpd-foreground b/httpd-foreground new file mode 100755 index 0000000..e896168 --- /dev/null +++ b/httpd-foreground @@ -0,0 +1,7 @@ +#!/bin/sh +set -e + +# Apache gets grumpy about PID files pre-existing +rm -f /usr/local/apache2/logs/httpd.pid + +exec httpd -DFOREGROUND "$@" From 5d5ab37b36c76d54706cae46449241da94caf9f5 Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:12:31 +0200 Subject: [PATCH 3/8] fix alpine image tag --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a1410f2..f17b8a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,7 @@ COPY --from=buildJS /build /build RUN cd /build/public/API && composer install # Prepare Webserver -FROM alpine:alpine +FROM alpine:latest # |-------------------------------------------------------------------------- # | install dependencies From 0f8f82a7664792df1003d4545df8c499b6470efb Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:17:46 +0200 Subject: [PATCH 4/8] fix httpd conf path --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index f17b8a5..c3cd11e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,8 +31,8 @@ COPY --from=composer /build/public /usr/local/apache2/htdocs/ # |-------------------------------------------------------------------------- # | enable apache modules # |-------------------------------------------------------------------------- -RUN sed -i '/LoadModule rewrite_module/s/^#//g' /usr/local/apache2/conf/httpd.conf && \ - sed -i 's#AllowOverride [Nn]one#AllowOverride All#' /usr/local/apache2/conf/httpd.conf +RUN sed -i '/LoadModule rewrite_module/s/^#//g' /etc/apache2/httpd.conf && \ + sed -i 's#AllowOverride [Nn]one#AllowOverride All#' /etc/apache2/httpd.conf # |-------------------------------------------------------------------------- # | enable healthcheck From 997dc82ef71a08f49ac90807b3740462d08c2d8a Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:23:40 +0200 Subject: [PATCH 5/8] fix wromg path for web page --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3cd11e..55f4d91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,12 +21,13 @@ FROM alpine:latest # |-------------------------------------------------------------------------- RUN apk update && \ apk upgrade && \ - apk add apache2 php8-apache2 php8-mysqli curl + apk add apache2 php8-apache2 php8-mysqli curl && \ + rm /var/www/localhost/htdocs/ # |-------------------------------------------------------------------------- # | copy website from node build # |-------------------------------------------------------------------------- -COPY --from=composer /build/public /usr/local/apache2/htdocs/ +COPY --from=composer /build/public /var/www/localhost/htdocs/ # |-------------------------------------------------------------------------- # | enable apache modules From 29b65b25989e7df96ca8d4c20fecc84c47f6ccb6 Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:27:55 +0200 Subject: [PATCH 6/8] add r flag to rm --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 55f4d91..88e89a6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,7 +22,7 @@ FROM alpine:latest RUN apk update && \ apk upgrade && \ apk add apache2 php8-apache2 php8-mysqli curl && \ - rm /var/www/localhost/htdocs/ + rm /var/www/localhost/htdocs/ -R # |-------------------------------------------------------------------------- # | copy website from node build From 177849f169285c41ff4bea37d067b6ad841f8a7d Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:37:19 +0200 Subject: [PATCH 7/8] add php-mbstring --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 88e89a6..21d064f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ FROM alpine:latest # |-------------------------------------------------------------------------- RUN apk update && \ apk upgrade && \ - apk add apache2 php8-apache2 php8-mysqli curl && \ + apk add apache2 php8-apache2 php8-mysqli php8-mbstring curl && \ rm /var/www/localhost/htdocs/ -R # |-------------------------------------------------------------------------- From e596fb13cf81e6857fdddae0fef672983f017c91 Mon Sep 17 00:00:00 2001 From: Jonas Leder Date: Mon, 16 Aug 2021 19:38:56 +0200 Subject: [PATCH 8/8] remove www in front of hcaptcha --- public/Anleitungen/nextcloud.html | 2 +- public/Anleitungen/snowboy.html | 2 +- public/Projekte/URLkuerzer1.html | 2 +- public/Projekte/URLkuerzer2.html | 2 +- public/Projekte/blitzortung.html | 2 +- public/Projekte/gclogLink.html | 2 +- public/Projekte/insecam.html | 2 +- public/Projekte/ledtisch1.html | 2 +- public/Projekte/ledtisch2.html | 2 +- public/Projekte/mqttpush.html | 2 +- public/Projekte/privateNote.html | 2 +- public/Projekte/proxdroid.html | 2 +- public/Projekte/regensensor.html | 2 +- public/Projekte/smartmirror.html | 2 +- public/Projekte/websitecloner.html | 2 +- public/Projekte/youtubedownloader.html | 2 +- public/impressum.html | 2 +- public/systeme/backupServer.html | 2 +- public/systeme/gameServer.html | 2 +- public/systeme/hpServer.html | 2 +- public/systeme/nas.html | 2 +- public/systeme/pc.html | 2 +- 22 files changed, 22 insertions(+), 22 deletions(-) diff --git a/public/Anleitungen/nextcloud.html b/public/Anleitungen/nextcloud.html index 742ce89..5715ac0 100644 --- a/public/Anleitungen/nextcloud.html +++ b/public/Anleitungen/nextcloud.html @@ -83,5 +83,5 @@ chown apache /var/www/localhost/htdocs/ -R - + \ No newline at end of file diff --git a/public/Anleitungen/snowboy.html b/public/Anleitungen/snowboy.html index 7b55ba5..e0fb8aa 100644 --- a/public/Anleitungen/snowboy.html +++ b/public/Anleitungen/snowboy.html @@ -65,5 +65,5 @@ make - + \ No newline at end of file diff --git a/public/Projekte/URLkuerzer1.html b/public/Projekte/URLkuerzer1.html index f9032ed..e32153a 100644 --- a/public/Projekte/URLkuerzer1.html +++ b/public/Projekte/URLkuerzer1.html @@ -41,5 +41,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/URLkuerzer2.html b/public/Projekte/URLkuerzer2.html index 06e6ae9..1d71893 100644 --- a/public/Projekte/URLkuerzer2.html +++ b/public/Projekte/URLkuerzer2.html @@ -48,5 +48,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/blitzortung.html b/public/Projekte/blitzortung.html index c873400..e83ae69 100644 --- a/public/Projekte/blitzortung.html +++ b/public/Projekte/blitzortung.html @@ -27,7 +27,7 @@ - + \ No newline at end of file diff --git a/public/Projekte/gclogLink.html b/public/Projekte/gclogLink.html index bbe1277..ae715db 100644 --- a/public/Projekte/gclogLink.html +++ b/public/Projekte/gclogLink.html @@ -24,5 +24,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/insecam.html b/public/Projekte/insecam.html index c34703a..d044fa1 100644 --- a/public/Projekte/insecam.html +++ b/public/Projekte/insecam.html @@ -45,5 +45,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/ledtisch1.html b/public/Projekte/ledtisch1.html index d89b05b..55761eb 100644 --- a/public/Projekte/ledtisch1.html +++ b/public/Projekte/ledtisch1.html @@ -141,5 +141,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/ledtisch2.html b/public/Projekte/ledtisch2.html index bbbf607..12b62b3 100644 --- a/public/Projekte/ledtisch2.html +++ b/public/Projekte/ledtisch2.html @@ -81,5 +81,5 @@ - + diff --git a/public/Projekte/mqttpush.html b/public/Projekte/mqttpush.html index dfdb59f..f10c576 100644 --- a/public/Projekte/mqttpush.html +++ b/public/Projekte/mqttpush.html @@ -26,5 +26,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/privateNote.html b/public/Projekte/privateNote.html index d150b8b..6f3327e 100644 --- a/public/Projekte/privateNote.html +++ b/public/Projekte/privateNote.html @@ -39,7 +39,7 @@ - + diff --git a/public/Projekte/proxdroid.html b/public/Projekte/proxdroid.html index c92da3d..ba65582 100644 --- a/public/Projekte/proxdroid.html +++ b/public/Projekte/proxdroid.html @@ -31,5 +31,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/regensensor.html b/public/Projekte/regensensor.html index a8fc02b..9d8613c 100644 --- a/public/Projekte/regensensor.html +++ b/public/Projekte/regensensor.html @@ -55,5 +55,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/smartmirror.html b/public/Projekte/smartmirror.html index 673fae9..8eff679 100644 --- a/public/Projekte/smartmirror.html +++ b/public/Projekte/smartmirror.html @@ -40,5 +40,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/websitecloner.html b/public/Projekte/websitecloner.html index 4ee414f..efe9b9e 100644 --- a/public/Projekte/websitecloner.html +++ b/public/Projekte/websitecloner.html @@ -19,5 +19,5 @@ - + \ No newline at end of file diff --git a/public/Projekte/youtubedownloader.html b/public/Projekte/youtubedownloader.html index 2c27a80..e00e6fa 100644 --- a/public/Projekte/youtubedownloader.html +++ b/public/Projekte/youtubedownloader.html @@ -25,5 +25,5 @@ - + \ No newline at end of file diff --git a/public/impressum.html b/public/impressum.html index 8851590..265bb21 100644 --- a/public/impressum.html +++ b/public/impressum.html @@ -9,7 +9,7 @@
- +

Impressum

Jonas Leder
diff --git a/public/systeme/backupServer.html b/public/systeme/backupServer.html index fb1107c..bfa8826 100644 --- a/public/systeme/backupServer.html +++ b/public/systeme/backupServer.html @@ -35,7 +35,7 @@

- + diff --git a/public/systeme/gameServer.html b/public/systeme/gameServer.html index 7bd72fe..d03e146 100644 --- a/public/systeme/gameServer.html +++ b/public/systeme/gameServer.html @@ -43,7 +43,7 @@ - + \ No newline at end of file diff --git a/public/systeme/hpServer.html b/public/systeme/hpServer.html index d81ae9d..bf9f3fa 100644 --- a/public/systeme/hpServer.html +++ b/public/systeme/hpServer.html @@ -40,7 +40,7 @@ - + \ No newline at end of file diff --git a/public/systeme/nas.html b/public/systeme/nas.html index f0227fc..a6b499d 100644 --- a/public/systeme/nas.html +++ b/public/systeme/nas.html @@ -35,7 +35,7 @@ - + \ No newline at end of file diff --git a/public/systeme/pc.html b/public/systeme/pc.html index b7515e1..557167a 100644 --- a/public/systeme/pc.html +++ b/public/systeme/pc.html @@ -47,7 +47,7 @@ - +