# syntax=docker/dockerfile:1 FROM ubuntu:22.04 LABEL maintainer="PhyreAppsDevelopers" # Install initial dependencies RUN apt-get update \ && apt-get install -y wget dos2unix ca-certificates \ && apt-get install -y \ jq \ curl \ wget \ unzip \ zip \ tar \ mysql-common \ mysql-server \ mysql-client \ lsb-release \ gnupg2 \ ca-certificates \ apt-transport-https \ software-properties-common \ supervisor \ libonig-dev \ libsodium23 \ libpq5 \ libzip-dev \ libcurl4-openssl-dev \ libssl-dev \ zlib1g-dev # Start MySQL service RUN service mysql start # Set up environment variables ENV INSTALL_DIR="/phyre/install" \ MYSQL_PHYRE_ROOT_USERNAME="phyre" \ PHYRE_PHP="/usr/local/phyre/php/bin/php" # Create installation directory RUN mkdir -p $INSTALL_DIR # Change directory to installation directory WORKDIR $INSTALL_DIR # Install PHYRE PHP RUN wget https://github.com/PhyreApps/PhyrePanelPHPDist/raw/main/debian/php/dist/phyre-php-8.2.0.deb \ && dpkg -i phyre-php-8.2.0.deb # Install PHYRE NGINX RUN wget https://github.com/PhyreApps/PhyrePanelNginxDist/raw/main/debian/nginx/dist/phyre-nginx-1.24.0.deb \ && dpkg -i phyre-nginx-1.24.0.deb # Start PHYRE service RUN service phyre start # Create symbolic link for PHYRE PHP RUN ln -s $PHYRE_PHP /usr/bin/phyre-php # Set permissions RUN chmod 711 /home \ && chmod -R 750 /usr/local/phyre # Change directory to web directory WORKDIR /usr/local/phyre/web # Create MySQL user RUN mysql -uroot -proot -e "CREATE USER '$MYSQL_PHYRE_ROOT_USERNAME'@'%' IDENTIFIED BY '$MYSQL_PHYRE_ROOT_PASSWORD'; \ GRANT ALL PRIVILEGES ON *.* TO '$MYSQL_PHYRE_ROOT_USERNAME'@'%' WITH GRANT OPTION; \ FLUSH PRIVILEGES;" # Create database RUN PANEL_DB_PASSWORD="$(tr -dc a-za-z0-9 /root/.phyre_mysql_root_password # Configure the application RUN cp .env.example .env \ && sed -i "s/^APP_URL=.*/APP_URL=http://127.0.0.1:8443/" .env \ && sed -i "s/^APP_NAME=.*/APP_NAME=PHYRE_PANEL/" .env \ && sed -i "s/^DB_DATABASE=.*/DB_DATABASE=$PANEL_DB_NAME/" .env \ && sed -i "s/^DB_USERNAME=.*/DB_USERNAME=$PANEL_DB_USER/" .env \ && sed -i "s/^DB_PASSWORD=.*/DB_PASSWORD=$PANEL_DB_PASSWORD/" .env \ && sed -i "s/^DB_CONNECTION=.*/DB_CONNECTION=mysql/" .env \ && sed -i "s/^MYSQl_ROOT_USERNAME=.*/MYSQl_ROOT_USERNAME=$MYSQL_ROOT_USERNAME/" .env \ && sed -i "s/^MYSQL_ROOT_PASSWORD=.*/MYSQL_ROOT_PASSWORD=$MYSQL_ROOT_PASSWORD/" .env # Generate application key and migrate database RUN phyre-php artisan key:generate \ && phyre-php artisan migrate \ && phyre-php artisan db:seed # Set permissions for storage and cache directories RUN chmod -R o+w /usr/local/phyre/web/storage/ \ && chmod -R o+w /usr/local/phyre/web/bootstrap/cache/ # Get current IP address RUN CURRENT_IP=$(curl -s ipinfo.io/ip) \ && echo "PhyrePanel downloaded successfully." \ && echo "Please visit http://$CURRENT_IP:8443 to continue installation of the panel."