bowler/docker/app/Dockerfile

26 lines
1006 B
Docker

FROM php:8.4-apache
# System packages + PHP extensions Laravel needs
RUN apt-get update \
&& apt-get install -y --no-install-recommends git unzip libzip-dev libicu-dev \
&& docker-php-ext-install pdo_mysql zip intl opcache \
&& a2enmod rewrite \
&& rm -rf /var/lib/apt/lists/*
# Composer (used by the entrypoint to install dependencies on first boot)
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER=1
# Serve Laravel's public/ directory
ENV APACHE_DOCUMENT_ROOT=/var/www/html/public
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' \
/etc/apache2/sites-available/*.conf /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# Strip Windows line endings in case the file was checked out with CRLF
RUN sed -i 's/\r$//' /usr/local/bin/entrypoint.sh && chmod +x /usr/local/bin/entrypoint.sh
WORKDIR /var/www/html
ENTRYPOINT ["entrypoint.sh"]
CMD ["apache2-foreground"]