FROM mysql:5.7 COPY my.cnf /etc/mysql/conf.d/ ENV MYSQL_ROOT_PASSWORD=rootpassword ENV MYSQL_DATABASE=mydatabase ENV MYSQL_USER=myuser ENV MYSQL_PASSWORD=mypassword RUN mysqld RUN ls FROM php:7.4-fpm # Set environment variables ENV COMPOSER_ALLOW_SUPERUSER=1 # Install system dependencies # Install system dependencies RUN apt-get update && apt-get install -y \ libpng-dev \ libjpeg-dev \ libfreetype6-dev \ libzip-dev \ libonig-dev \ libxml2-dev \ libcurl4-openssl-dev \ libicu-dev \ unzip \ git \ zlib1g-dev \ libxslt-dev \ mariadb-client \ && docker-php-ext-configure gd --with-freetype --with-jpeg \ && docker-php-ext-install gd zip pdo pdo_mysql mysqli \ && pecl install xdebug-3.0.4 \ && docker-php-ext-enable xdebug \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Install Composer COPY --from=composer:2 /usr/bin/composer /usr/bin/composer # Copy the custom initialization script # COPY init-db.sh /usr/local/bin/init-db.sh # RUN chmod +x /usr/local/bin/init-db.sh # Initialize MySQL database # RUN bash init-db.sh # RUN mysql -u root -proot -e "CREATE DATABASE IF NOT EXISTS big;" # Set the working directory WORKDIR /var/www # Copy application files COPY . /var/www RUN ls RUN composer create-project bagisto/bagisto RUN cp .env /var/www/bagisto RUN cd bagisto RUN ls WORKDIR /var/www/bagisto RUN ls # Install Bagisto dependencies RUN composer install # Generate application key RUN php artisan key:generate # Run Bagisto installation RUN php artisan bagisto:install RUN php artisan migrate RUN php artisan db:seed RUN php artisan vendor:publish --all RUN php artisan storage:link RUN ls # Expose port 7860 EXPOSE 7860 # Start the PHP-FPM server CMD ["php-fpm"]