aurweb/docker/nginx-entrypoint.sh
Kevin Morris d4d9f50b8f
change(docker): use ./data instead of ./cache
For the `git` service, ./data is always used to provide an
optional overriding of ssh host keys. In aur-dev production
containers, most services which use the data mount use an
internal Docker `data` volume instead.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-20 20:05:32 -08:00

24 lines
638 B
Bash
Executable file

#!/bin/bash
set -eou pipefail
# If production.{cert,key}.pem exists, prefer them. This allows
# user customization of the certificates that FastAPI uses.
# Otherwise, fallback to localhost.{cert,key}.pem, generated by `ca`.
CERT=/data/production.cert.pem
KEY=/data/production.key.pem
DEST_CERT=/etc/ssl/certs/web.cert.pem
DEST_KEY=/etc/ssl/private/web.key.pem
if [ -f "$CERT" ]; then
cp -vf "$CERT" "$DEST_CERT"
cp -vf "$KEY" "$DEST_KEY"
else
cat /data/localhost.cert.pem /data/ca.root.pem > "$DEST_CERT"
cp -vf /data/localhost.key.pem "$DEST_KEY"
fi
cp -vf /docker/config/nginx.conf /etc/nginx/nginx.conf
exec "$@"