dashboard-nanobot/frontend/docker/entrypoint.sh

20 lines
354 B
Bash

#!/bin/sh
set -eu
size="${UPLOAD_MAX_MB:-100}"
size="$(printf '%s' "$size" | tr -d '[:space:]')"
if [ -z "$size" ]; then
size="100"
fi
case "$size" in
*[kKmMgG]) ;;
*) size="${size}m" ;;
esac
sed "s/__CLIENT_MAX_BODY_SIZE__/${size}/g" \
/etc/nginx/conf.d/default.conf.template \
> /etc/nginx/conf.d/default.conf
exec nginx -g "daemon off;"