Optional HTTPD support

This commit is contained in:
3wc 2024-10-08 23:54:54 -04:00
parent 9a17ed957a
commit 5994b255c7
6 changed files with 51 additions and 10 deletions

View File

@ -3,6 +3,8 @@ export NGINX_DEFAULT_CONF_VERSION=v7
export PHP_UPLOADS_CONF_VERSION=v4
export ENTRYPOINT_CONF_VERSION=v1
export ENTRYPOINT_MAILRELAY_CONF_VERSION=v1
export ENTRYPOINT_HTTPD_CONF_VERSION=v1
export HTTPD_VHOSTS_CONF_VERSION=v1
export MSMTP_CONF_VERSION=v3
abra_backup_app() {

View File

@ -21,14 +21,22 @@ services:
- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
- coop-cloud.${STACK_NAME}.frontend.version=1.20-c628b67d
volumes:
- site_content:/usr/local/apache2/htdocs/
# configs:
# - source: httpd_default_conf
# target: /usr/local/apache2/conf/httpd.conf
- site_content:/var/www/html/
entrypoint: "/docker-entrypoint.sh"
#configs:
# httpd_default_conf:
# name: ${STACK_NAME}_httpd_default_conf_${HTTPD_DEFAULT_CONF_VERSION}
# file: httpd.conf
# template_driver: golang
configs:
- source: entrypoint_httpd_conf
target: /docker-entrypoint.sh
mode: 0555
- source: httpd_vhosts_conf
target: /usr/local/apache2/conf/extra/httpd-vhosts.conf
configs:
entrypoint_httpd_conf:
name: ${STACK_NAME}_entrypoint_httpd_conf_${ENTRYPOINT_HTTPD_CONF_VERSION}
file: entrypoint.httpd.sh
httpd_vhosts_conf:
name: ${STACK_NAME}_httpd_vhosts_conf_${HTTPD_VHOSTS_CONF_VERSION}
file: httpd-vhosts.conf
template_driver: golang

View File

@ -51,6 +51,7 @@ services:
environment:
- STACK_NAME
- ROOT_PATH
- DOMAIN
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost"]
# interval: 30s

10
entrypoint.httpd.sh Normal file
View File

@ -0,0 +1,10 @@
#!/bin/sh
sed -i 's,#Include conf/extra/httpd-vhosts.conf,Include conf/extra/httpd-vhosts.conf,g' /usr/local/apache2/conf/httpd.conf
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 && \
sed -i '/LoadModule proxy_module/s/^#//g' /usr/local/apache2/conf/httpd.conf
sed -i '/LoadModule proxy_fcgi_module/s/^#//g' /usr/local/apache2/conf/httpd.conf
httpd-foreground

17
httpd-vhosts.conf Normal file
View File

@ -0,0 +1,17 @@
<VirtualHost *:80>
DocumentRoot /var/www/html/
ServerName {{ env "DOMAIN" }}
ErrorLog logs/{{ env "DOMAIN" }}-error_log
CustomLog logs/{{ env "DOMAIN" }}-access_log common
<Directory /var/www/html/>
AllowOverride All
DirectoryIndex index.php index.php
Options -Indexes
Require all granted
</Directory>
<FilesMatch \.php$>
SetHandler "proxy:fcgi://{{ env "STACK_NAME" }}_app:9000"
</FilesMatch>
</VirtualHost>

3
release/next Normal file
View File

@ -0,0 +1,3 @@
This version adds optional HTTPD (apache) support, instead of the default Nginx.
This "should" be "fine", but please proceed with caution, taking a backup before
upgrade probably even more important than usual.