diff --git a/openlitespeed/Dockerfile b/openlitespeed/Dockerfile index cfee7a3..1e78678 100644 --- a/openlitespeed/Dockerfile +++ b/openlitespeed/Dockerfile @@ -11,7 +11,7 @@ ARG TARGETPLATFORM # Install necessary packages RUN apt-get update && apt-get install -y --no-install-recommends \ wget curl cron less tzdata gnupg2 ca-certificates procps libatomic1 \ - msmtp git \ + msmtp git mysql-client \ && rm -rf /var/lib/apt/lists/* # Download and install OpenLiteSpeed @@ -48,8 +48,8 @@ RUN wget -qO /usr/local/bin/composer https://getcomposer.org/download/latest-sta && chmod +x /usr/local/bin/wp \ && echo "alias wp='wp --allow-root'" >> /root/.bashrc -# Set up www-data user -RUN usermod -u 1000 www-data +# Clearing Group ID 1000 for later use +RUN groupmod -g 999 lsadm # Create necessary directories RUN mkdir -p /var/www/html/public /var/www/html/logs \ diff --git a/openlitespeed/build.sh b/openlitespeed/build.sh index bb3f834..dedc5ec 100644 --- a/openlitespeed/build.sh +++ b/openlitespeed/build.sh @@ -3,7 +3,7 @@ # Set variables DOCKER_HUB_USERNAME="meghsh" IMAGE_NAME="openlitespeed" -OLS_VERSION="1.8.1" +OLS_VERSION="1.8.3" # Ensure BuildKit is enabled export DOCKER_BUILDKIT=1 diff --git a/openlitespeed/entrypoint.sh b/openlitespeed/entrypoint.sh index e9f1878..1f954bc 100644 --- a/openlitespeed/entrypoint.sh +++ b/openlitespeed/entrypoint.sh @@ -1,6 +1,24 @@ #!/bin/bash set -e +echo "www-data UID is: $(id -u www-data) and GID $(id -g www-data)" + +# Check and set PGID and PUID separately +if [ -z "$PGID" ]; then + echo "PGID not set, using default." + PGID=1000 +fi + +if [ -z "$PUID" ]; then + echo "PUID not set, using default." + PUID=1000 +fi + +echo "setting GID to $PGID and UID to $PUID" + +groupmod -g $PGID www-data +usermod -u $PUID www-data + # Ensure correct permissions chown -R www-data:www-data /var/www/html chown -R lsadm:lsadm /usr/local/lsws