# Use nginx:stable-alpine as the base image FROM nginx:stable-alpine # Set environment variables ENV DEBIAN_FRONTEND=noninteractive ENV LC_ALL=C.UTF-8 # Install required packages RUN apk update && \ apk add --no-cache \ git \ wget \ curl \ unzip \ php7 \ php7-fpm \ php7-common \ php7-mysqli \ php7-xml \ php7-xmlrpc \ php7-curl \ php7-gd \ php7-imagick \ php7-dev \ php7-imap \ php7-mbstring \ php7-opcache \ php7-soap \ php7-zip \ php7-intl # Configure Nginx RUN echo "server { \ listen 7860; \ root /var/www/html; \ index index.php index.html index.htm; \ location / { \ try_files \$uri \$uri/ =404; \ } \ location ~ \.php$ { \ fastcgi_pass 127.0.0.1:9000; \ fastcgi_index index.php; \ include fastcgi_params; \ } \ }" > /etc/nginx/conf.d/default.conf # Clone the Rapidleech repo and configure RUN mkdir -p /var/www && \ cd /var/www && \ rm -rf html && \ git clone https://github.com/PBhadoo/Rapidleech html && \ cd /var/www/html && \ mkdir files && \ chmod 777 files && \ chmod 777 configs && \ chmod 777 configs/files.lst && \ rm -rf rar && \ wget https://rarlab.com/rar/rarlinux-x64-612.tar.gz && \ tar -xvf rarlinux-x64-612.tar.gz && \ rm -f rarlinux-x64-612.tar.gz && \ chmod -R 777 rar && \ chmod -R 777 rar/* && \ sed -i "s/'download_dir_is_changeable' => false,/'download_dir_is_changeable' => true,/" /var/www/html/configs/config.php && \ sed -i "s/'disable_delete' => true,/'disable_delete' => false,/" /var/www/html/configs/config.php # Expose the desired port EXPOSE 7860 # Start Nginx and PHP-FPM CMD php-fpm7 && nginx -g 'daemon off;'