FROM ubuntu:18.04


#base dev
RUN sed -i "s/archive.ubuntu/mirrors.aliyun/g" /etc/apt/sources.list
RUN apt-get update
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get install wget -y
RUN wget -O - https://rpms.litespeedtech.com/debian/enable_lst_debian_repo.sh | bash
RUN apt-get install openlitespeed -y
RUN apt-get install lsphp74 -y
RUN apt-get install php-curl -y

RUN chmod 4755 /bin/cat
RUN rm -rf /usr/local/lsws/Example/html/upload.*
RUN rm -rf /usr/local/lsws/Example/html/index.html

COPY html/ /usr/local/lsws/Example/html/
COPY conf/httpd_config.conf /usr/local/lsws/conf/httpd_config.conf
RUN chmod 755 /usr/local/lsws/conf/httpd_config.conf
COPY libs/curl.so /usr/local/lsws/lsphp74/lib/php/20190902/curl.so
RUN chmod 755 /usr/local/lsws/lsphp74/lib/php/20190902/curl.so
RUN echo 'extension=curl.so' >> /usr/local/lsws/lsphp74/etc/php/7.4/litespeed/php.ini

COPY start.sh /start.sh
RUN chmod +x /start.sh

ENTRYPOINT ["/start.sh"]