switch to hybrid

This commit is contained in:
aptalca 2022-08-17 11:21:42 -04:00
parent 2be858578a
commit 23b8ace1fb
7 changed files with 43 additions and 1 deletions

View File

@ -1,4 +1,4 @@
FROM ghcr.io/linuxserver/baseimage-alpine:3.12 as grab-stage
FROM ghcr.io/linuxserver/baseimage-alpine:3.15 as grab-stage
RUN \
apk add --no-cache --upgrade \

View File

@ -0,0 +1,40 @@
#!/usr/bin/with-contenv bash
# shellcheck shell=bash
###
# SWAG LOGIC https://github.com/linuxserver/docker-swag/blob/master/root/etc/cont-init.d/50-config
###
# copy reverse proxy configs
cp -R /defaults/proxy-confs /config/nginx/
# copy proxy defaults
[[ ! -f /config/nginx/proxy.conf ]] &&
cp /defaults/proxy.conf /config/nginx/proxy.conf
[[ ! -f /config/nginx/ssl.conf ]] &&
cp /defaults/ssl.conf /config/nginx/ssl.conf
# Set resolver
if ! grep -q 'resolver' /config/nginx/resolver.conf; then
RESOLVER=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print $2}' /etc/resolv.conf)
echo "Setting resolver to ${RESOLVER}"
echo -e "# This file is auto-generated only on first start, based on the container's /etc/resolv.conf file. Feel free to modify it as you wish.\n\nresolver ${RESOLVER} valid=30s;" > /config/nginx/resolver.conf
fi
# Set worker_processes
if ! grep -q 'worker_processes' /config/nginx/worker_processes.conf; then
WORKER_PROCESSES=$(nproc)
echo "Setting worker_processes to ${WORKER_PROCESSES}"
echo -e "# This file is auto-generated only on first start, based on the cpu cores detected. Feel free to change it to any other number or to auto to let nginx handle it automatically.\n\nworker_processes ${WORKER_PROCESSES};" > /config/nginx/worker_processes.conf
fi
# copy pre-generated dhparams or generate if needed
[[ ! -f /config/nginx/dhparams.pem ]] && \
cp /defaults/dhparams.pem /config/nginx/dhparams.pem
if ! grep -q 'PARAMETERS' "/config/nginx/dhparams.pem"; then
curl -o /config/nginx/dhparams.pem -L "https://ssl-config.mozilla.org/ffdhe4096.txt"
fi
# permissions
chown -R abc:abc \
/config/nginx/{proxy.conf,ssl.conf,dhparams.pem,proxy-confs/}

View File

@ -0,0 +1 @@
oneshot

View File

@ -0,0 +1 @@
/etc/s6-overlay/s6-rc.d/init-mod-nginx-proxy-confs-setup/run