Merge branch 'alpine-webserver' into 'master'

Alpine webserver

See merge request jonasled/website!3
This commit is contained in:
Jonas Leder 2021-08-16 19:48:24 +02:00
commit 22d193f205
24 changed files with 45 additions and 34 deletions

View file

@ -14,35 +14,39 @@ COPY --from=buildJS /build /build
RUN cd /build/public/API && composer install
# Prepare Webserver
FROM php:8-apache-buster
FROM alpine:latest
# |--------------------------------------------------------------------------
# | 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 apache2 php8-apache2 php8-mysqli php8-mbstring curl && \
rm /var/www/localhost/htdocs/ -R
# |--------------------------------------------------------------------------
# | copy website from node build
# |--------------------------------------------------------------------------
COPY --from=composer /build/public /var/www/html
COPY --from=composer /build/public /var/www/localhost/htdocs/
# |--------------------------------------------------------------------------
# | enable apache modules
# |--------------------------------------------------------------------------
RUN a2enmod headers rewrite
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 metrics
# | enable healthcheck
# |--------------------------------------------------------------------------
RUN apt update && apt install curl
HEALTHCHECK CMD curl --fail http://localhost || exit 1
# |--------------------------------------------------------------------------
# | expose http port
# |--------------------------------------------------------------------------
EXPOSE 80
# |--------------------------------------------------------------------------
# | set entrypoint
# |--------------------------------------------------------------------------
COPY httpd-foreground /usr/local/bin/
CMD ["httpd-foreground"]

7
httpd-foreground Executable file
View file

@ -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 "$@"

View file

@ -83,5 +83,5 @@ chown apache /var/www/localhost/htdocs/ -R</code>
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -65,5 +65,5 @@ make</code></pre>
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -41,5 +41,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -48,5 +48,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -27,7 +27,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>
</html>

View file

@ -24,5 +24,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -45,5 +45,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -141,5 +141,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -81,5 +81,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -26,5 +26,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -39,7 +39,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>

View file

@ -31,5 +31,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -55,5 +55,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -40,5 +40,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -19,5 +19,5 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>

View file

@ -25,5 +25,5 @@
</div>
<jl-footer></jl-footer>
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<script src="/js/script.js"></script>

View file

@ -9,7 +9,7 @@
<body>
<jl-header data-title="Impressum"></jl-header>
<div id="content">
<script async defer src='https://www.hCaptcha.com/1/api.js'></script>
<script async defer src='https://hCaptcha.com/1/api.js'></script>
<h2>Impressum</h2>
<p>
Jonas Leder<br>

View file

@ -35,7 +35,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>
</html>

View file

@ -43,7 +43,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>
</html>

View file

@ -40,7 +40,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>
</html>

View file

@ -35,7 +35,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>
</html>

View file

@ -47,7 +47,7 @@
</div>
<jl-footer></jl-footer>
<script src='https://www.hCaptcha.com/1/api.js' async defer></script>
<script src='https://hCaptcha.com/1/api.js' async defer></script>
<script src="/js/script.js"></script>
</body>
</html>