36 lines
1.4 KiB
Docker
36 lines
1.4 KiB
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 curl ca-certificates libzip-dev libicu-dev \
|
|
&& docker-php-ext-install pdo_mysql zip intl opcache \
|
|
&& a2enmod rewrite \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Tailwind CSS standalone CLI (no Node.js required)
|
|
ARG TARGETARCH=amd64
|
|
RUN case "$TARGETARCH" in \
|
|
arm64) TW_ARCH=arm64 ;; \
|
|
*) TW_ARCH=x64 ;; \
|
|
esac \
|
|
&& curl -fsSL -o /usr/local/bin/tailwindcss \
|
|
"https://github.com/tailwindlabs/tailwindcss/releases/latest/download/tailwindcss-linux-${TW_ARCH}" \
|
|
&& chmod +x /usr/local/bin/tailwindcss
|
|
|
|
# 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"]
|