|
| 1 | +FROM php:8.1-apache |
| 2 | + |
| 3 | +# Copy virtual host into container |
| 4 | +COPY 000-default.conf /etc/apache2/sites-available/000-default.conf |
| 5 | + |
| 6 | +# Enable rewrite mode |
| 7 | +RUN a2enmod rewrite |
| 8 | + |
| 9 | +# Install necessary packages |
| 10 | +RUN apt-get update && \ |
| 11 | + apt-get install \ |
| 12 | + libzip-dev \ |
| 13 | + wget \ |
| 14 | + git \ |
| 15 | + unzip \ |
| 16 | + -y --no-install-recommends |
| 17 | + |
| 18 | +# Install PHP Extensions |
| 19 | +RUN docker-php-ext-install zip pdo_mysql |
| 20 | + |
| 21 | +# RUN pecl install -o -f xdebug-3.1.3 \ |
| 22 | +# && rm -rf /tmp/pear |
| 23 | + |
| 24 | +# Copy composer installable |
| 25 | +COPY ./install-composer.sh ./ |
| 26 | + |
| 27 | +# Copy php.ini |
| 28 | +COPY ./php.ini /usr/local/etc/php/ |
| 29 | + |
| 30 | +# Cleanup packages and install composer |
| 31 | +RUN apt-get purge -y g++ \ |
| 32 | + && apt-get autoremove -y \ |
| 33 | + && rm -r /var/lib/apt/lists/* \ |
| 34 | + && rm -rf /tmp/* \ |
| 35 | + && sh ./install-composer.sh \ |
| 36 | + && rm ./install-composer.sh |
| 37 | + |
| 38 | +# Change the current working directory |
| 39 | +WORKDIR /var/www |
| 40 | + |
| 41 | +# Change the owner of the container document root |
| 42 | +RUN chown -R www-data:www-data /var/www |
| 43 | + |
| 44 | +# Start Apache in foreground |
| 45 | +CMD ["apache2-foreground"] |
| 46 | + |
0 commit comments