| ARG RELEASE |
| ARG LAUNCHPAD_BUILD_ARCH |
| LABEL org.opencontainers.image.ref.name=ubuntu |
| LABEL org.opencontainers.image.version=24.04 |
| ADD file:249778a1782b02a1c2bcf9f292f5778d81442a53c3de1958d712f10baf7e0b60 in / |
| CMD ["/bin/bash"] |
| ARG OLS_VERSION=1.8.4 |
| ARG PHP_VERSION=lsphp81 |
| ARG TARGETPLATFORM=linux/amd64 |
| ENV LS_FD=/usr/local/lsws |
| ENV PHPINI_PATH=/usr/local/lsws/lsphp81/etc/php/*/litespeed/php.ini |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c apt-get update && apt-get install wget curl cron tzdata -y # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c if [ "$TARGETPLATFORM" = "linux/amd64" ]; then wget https://openlitespeed.org/packages/openlitespeed-$OLS_VERSION-x86_64-linux.tgz && tar xzf openlitespeed-$OLS_VERSION-x86_64-linux.tgz && cd openlitespeed && ./install.sh && echo 'cloud-docker' > $LS_FD/PLAT && rm -rf /openlitespeed && rm /openlitespeed-$OLS_VERSION-x86_64-linux.tgz; elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then wget https://openlitespeed.org/packages/openlitespeed-$OLS_VERSION-aarch64-linux.tgz && tar xzf openlitespeed-$OLS_VERSION-aarch64-linux.tgz && cd openlitespeed && ./install.sh && echo 'cloud-docker' > $LS_FD/PLAT && rm -rf /openlitespeed && rm /openlitespeed-$OLS_VERSION-aarch64-linux.tgz; else echo "$TARGETPLATFORM is not supported"; fi # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c wget -O - https://repo.litespeed.sh | bash # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c apt-get install mysql-client $PHP_VERSION $PHP_VERSION-common $PHP_VERSION-mysql $PHP_VERSION-opcache $PHP_VERSION-curl $PHP_VERSION-imagick $PHP_VERSION-redis $PHP_VERSION-memcached $PHP_VERSION-intl -y # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/bash -c if [[ $PHP_VERSION == lsphp7* ]]; then apt-get install $PHP_VERSION-json -y; fi # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c wget -O $LS_FD/admin/misc/lsup.sh https://raw.githubusercontent.com/litespeedtech/openlitespeed/master/dist/admin/misc/lsup.sh && chmod +x $LS_FD/admin/misc/lsup.sh # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c sed -i 's/memory_limit = 128M/memory_limit = 1024M/g' $PHPINI_PATH && sed -i 's/upload_max_filesize = 2M/upload_max_filesize = 1024M/g' $PHPINI_PATH && sed -i 's/post_max_size = 8M/post_max_size = 1024M/g' $PHPINI_PATH && sed -i 's/max_execution_time = 30/max_execution_time = 300/g' $PHPINI_PATH # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar && chmod +x wp-cli.phar && mv wp-cli.phar /usr/bin/wp && ln -s $LS_FD/$PHP_VERSION/bin/php /usr/bin/php # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c wget -O - https://get.acme.sh | sh # buildkit |
| EXPOSE [7080/tcp] |
| ENV PATH=/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/bin |
| ADD docker.conf /usr/local/lsws/conf/templates/docker.conf # buildkit |
| ADD setup_docker.sh /usr/local/lsws/bin/setup_docker.sh # buildkit |
| ADD htpasswd /usr/local/lsws/admin/conf/htpasswd # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c $LS_FD/bin/setup_docker.sh && rm $LS_FD/bin/setup_docker.sh # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c chown 994:994 $LS_FD/conf -R # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c cp -RP $LS_FD/conf/ $LS_FD/.conf/ # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c cp -RP $LS_FD/admin/conf $LS_FD/admin/.conf/ # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/bash -c if [[ $PHP_VERSION == lsphp8* ]]; then ln -sf $LS_FD/$PHP_VERSION/bin/lsphp $LS_FD/fcgi-bin/lsphp8; fi # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/bash -c if [[ $PHP_VERSION == lsphp8* ]]; then ln -sf $LS_FD/fcgi-bin/lsphp8 $LS_FD/fcgi-bin/lsphp; fi # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/bash -c if [[ $PHP_VERSION == lsphp7* ]]; then ln -sf $LS_FD/$PHP_VERSION/bin/lsphp $LS_FD/fcgi-bin/lsphp7; fi # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/bash -c if [[ $PHP_VERSION == lsphp7* ]]; then ln -sf $LS_FD/fcgi-bin/lsphp7 $LS_FD/fcgi-bin/lsphp; fi # buildkit |
| COPY entrypoint.sh /entrypoint.sh # buildkit |
| RUN |3 OLS_VERSION=1.8.4 PHP_VERSION=lsphp81 TARGETPLATFORM=linux/amd64 /bin/sh -c chmod +x /entrypoint.sh # buildkit |
| ENTRYPOINT ["/entrypoint.sh"] |
| WORKDIR /var/www/vhosts/ |
| ARG PHPVER=81 |
| ENV PHPVER=81 |
| COPY /build-out/lsphp.version /etc/cac-lsphp-build.version # buildkit |
| RUN |1 PHPVER=81 /bin/sh -c set -e; V=$(cat /etc/cac-lsphp-build.version); apt-get update; if ! DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates lsphp${PHPVER}="$V" lsphp${PHPVER}-common="$V" lsphp${PHPVER}-ldap="$V"; then echo "FATAL: lsphp${PHPVER} $V is what cac_path_parity was compiled against," >&2; echo " but the LiteSpeed repo no longer offers it (it keeps only the" >&2; echo " current release). The ext-build stage is almost certainly a stale" >&2; echo " cache hit — rebuild with --no-cache." >&2; exit 1; fi; apt-get clean; rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*; RTV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}); CMV=$(dpkg-query -W -f='${Version}' lsphp${PHPVER}-common); if [ "$RTV" != "$V" ] || [ "$CMV" != "$V" ]; then echo "FATAL: cac_path_parity.so was compiled against lsphp${PHPVER} $V but this" >&2; echo " image would ship lsphp${PHPVER}=$RTV / -common=$CMV." >&2; echo " Rebuild with --no-cache so both stages resolve the same release." >&2; exit 1; fi; echo "runtime lsphp${PHPVER} pinned to $V (the version cac_path_parity was built against)" # buildkit |
| COPY ./scripts/entrypoint-lsphp.sh ./scripts/detect-memory-lsphp.sh ./scripts/healthcheck-lsphp.sh ./scripts/cac-lsphp-normalize.php /scripts/ # buildkit |
| RUN |1 PHPVER=81 /bin/sh -c chmod +x /scripts/entrypoint-lsphp.sh /scripts/detect-memory-lsphp.sh /scripts/healthcheck-lsphp.sh # buildkit |
| COPY ./configs/litespeed/lsphp-overrides.ini /etc/lsws-templates/lsphp-overrides.ini # buildkit |
| RUN |1 PHPVER=81 /bin/sh -c bash -c 'set -e; SCAN_DIR=$(/usr/local/lsws/lsphp${PHPVER}/bin/lsphp -i 2>/dev/null | awk -F"=> " "/^Scan this dir/ {print \$2; exit}"); mkdir -p "$SCAN_DIR"; cp /etc/lsws-templates/lsphp-overrides.ini "$SCAN_DIR/99-prod-overrides.ini"; echo "wrote overrides to $SCAN_DIR"' # buildkit |
| COPY /build-out/cac_path_parity.so /tmp/cac_path_parity.so # buildkit |
| RUN |1 PHPVER=81 /bin/sh -c bash -c 'set -e; LSPHP="/usr/local/lsws/lsphp${PHPVER}/bin/lsphp"; EXT_DIR=$("$LSPHP" -i 2>/dev/null | awk -F" => " "/^extension_dir/ {print \$2; exit}"); SCAN_DIR=$("$LSPHP" -i 2>/dev/null | awk -F"=> " "/^Scan this dir/ {print \$2; exit}"); mkdir -p "$EXT_DIR" "$SCAN_DIR"; mv /tmp/cac_path_parity.so "$EXT_DIR/"; printf "; installed by Dockerfile.lsphp\nextension=cac_path_parity.so\n" > "$SCAN_DIR/00-cac-path-parity.ini"; "$LSPHP" -i 2>/dev/null | grep -q "^cac_path_parity support => enabled$"; echo "cac_path_parity installed into $EXT_DIR and verified loadable"' # buildkit |
| ENV LSPHP_ENABLE_USER_INI=on |
| EXPOSE [9000/tcp] |
| HEALTHCHECK {Test:[CMD-SHELL /scripts/healthcheck-lsphp.sh] Interval:30s Timeout:5s StartPeriod:15s StartInterval:0s Retries:3} |
| ENTRYPOINT ["/scripts/entrypoint-lsphp.sh"] |