Merge pull request #43 from ej52/develop

fix: Ubuntu fixes
This commit is contained in:
Elton Renda 2021-08-12 10:45:25 +02:00 committed by GitHub
commit 24c215ff85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,6 +7,7 @@ TEMPLOG="$TEMPDIR/tmplog"
TEMPERR="$TEMPDIR/tmperr" TEMPERR="$TEMPDIR/tmperr"
LASTCMD="" LASTCMD=""
WGETOPT="-t 1 -T 15 -q" WGETOPT="-t 1 -T 15 -q"
DEVDEPS="build-essential python3-dev git"
NPMURL="https://github.com/jc21/nginx-proxy-manager" NPMURL="https://github.com/jc21/nginx-proxy-manager"
cd $TEMPDIR cd $TEMPDIR
@ -40,7 +41,7 @@ trapexit() {
fi fi
# Cleanup # Cleanup
apt-get remove --purge -y build-essential python3-dev git -qq &>/dev/null apt-get remove --purge -y $DEVDEPS -qq &>/dev/null
apt-get autoremove -y -qq &>/dev/null apt-get autoremove -y -qq &>/dev/null
apt-get clean apt-get clean
rm -rf $TEMPDIR rm -rf $TEMPDIR
@ -63,20 +64,24 @@ if [ -f /lib/systemd/system/npm.service ]; then
/var/cache/nginx &>/dev/null /var/cache/nginx &>/dev/null
fi fi
# Install dependencies # Update container OS
log "Installing dependencies" log "Updating container OS"
echo "fs.file-max = 65535" > /etc/sysctl.conf echo "fs.file-max = 65535" > /etc/sysctl.conf
runcmd apt-get update runcmd apt-get update
runcmd apt-get -y install --no-install-recommends wget gnupg openssl ca-certificates apache2-utils logrotate build-essential python3-dev git runcmd apt-get upgrade -y
# Install dependencies
log "Installing dependencies"
runcmd 'apt-get -y install --no-install-recommends wget gnupg openssl ca-certificates apache2-utils logrotate $DEVDEPS'
# Install Python # Install Python
log "Installing python" log "Installing python"
runcmd apt-get install -y -q --no-install-recommends python3 python3-pip python3-venv runcmd apt-get install -y -q --no-install-recommends python3 python3-pip python3-venv
python3 -m venv /opt/certbot/ python3 -m venv /opt/certbot/
if [ "$(getconf LONG_BIT)" = "32" ]; then # Install certbot and python dependancies
runcmd pip install --no-cache-dir -U cryptography==3.3.2 runcmd pip3 install --upgrade setuptools
fi runcmd pip3 install --no-cache-dir -U cryptography==3.3.2
runcmd pip install --no-cache-dir cffi certbot runcmd pip3 install --no-cache-dir cffi certbot
# Install openresty # Install openresty
log "Installing openresty" log "Installing openresty"
@ -105,6 +110,7 @@ cd ./nginx-proxy-manager-$_latest_version
log "Setting up enviroment" log "Setting up enviroment"
# Crate required symbolic links # Crate required symbolic links
ln -sf /usr/bin/python3 /usr/bin/python ln -sf /usr/bin/python3 /usr/bin/python
ln -sf /usr/bin/pip3 /usr/bin/pip
ln -sf /usr/bin/certbot /opt/certbot/bin/certbot ln -sf /usr/bin/certbot /opt/certbot/bin/certbot
ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx ln -sf /usr/local/openresty/nginx/sbin/nginx /usr/sbin/nginx
ln -sf /usr/local/openresty/nginx/ /etc/nginx ln -sf /usr/local/openresty/nginx/ /etc/nginx
@ -207,7 +213,7 @@ Wants=openresty.service
[Service] [Service]
Type=simple Type=simple
Environment=NODE_ENV=production Environment=NODE_ENV=production
ExecStartPre=-mkdir -p /tmp/nginx/body /data/letsencrypt-acme-challenge ExecStartPre=-/bin/mkdir -p /tmp/nginx/body /data/letsencrypt-acme-challenge
ExecStart=/usr/bin/node index.js --abort_on_uncaught_exception --max_old_space_size=250 ExecStart=/usr/bin/node index.js --abort_on_uncaught_exception --max_old_space_size=250
WorkingDirectory=/app WorkingDirectory=/app
Restart=on-failure Restart=on-failure