Files
docker-images/nginx/install.sh
Walter Oggioni 8b0c982b25
All checks were successful
CI / Build nginx docker images (push) Successful in 16s
switched nginx from boringssl to libressl
2025-04-16 21:29:29 +08:00

27 lines
977 B
Bash

#!/usr/bin/env sh
set -e
make install
rm -rf /etc/nginx/html/
mkdir -p /etc/nginx/conf.d/
mkdir -p /usr/share/nginx/html/
install -m644 docs/html/index.html /usr/share/nginx/html/
install -m644 docs/html/50x.html /usr/share/nginx/html/
ln -s ../../usr/lib/nginx/modules /etc/nginx/modules
strip /usr/sbin/nginx*
strip /usr/lib/nginx/modules/*.so
# Bring in gettext so we can get `envsubst`, then throw
# the rest away. To do this, we need to install `gettext`
# then move `envsubst` out of the way so `gettext` can
# be deleted completely, then move `envsubst` back.
apk add --no-cache --virtual .gettext gettext
mv /usr/bin/envsubst /tmp/
runDeps="libintl libxml2 musl zlib tzdata ca-certificates pcre brotli-libs libxslt geoip"
apk add --no-cache $runDeps
apk del .gettext
mv /tmp/envsubst /usr/local/bin/
# forward request and error logs to docker log collect
mkdir -p /var/log/nginx
ln -sf /dev/stdout /var/log/nginx/access.log
ln -sf /dev/stderr /var/log/nginx/error.log