69 lines
1.6 KiB
Docker
Executable File
69 lines
1.6 KiB
Docker
Executable File
FROM php:8.3-apache
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
libicu-dev \
|
|
libzip-dev \
|
|
libonig-dev \
|
|
libssh2-1 \
|
|
libssh2-1-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pecl install ssh2 \
|
|
&& docker-php-ext-enable ssh2 \
|
|
&& docker-php-ext-configure intl \
|
|
&& docker-php-ext-install \
|
|
pdo \
|
|
pdo_mysql \
|
|
mysqli \
|
|
intl \
|
|
ftp \
|
|
mbstring \
|
|
bcmath \
|
|
zip
|
|
|
|
RUN a2enmod rewrite
|
|
|
|
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
|
|
|
|
WORKDIR /var/www/app
|
|
|
|
ENV APACHE_DOCUMENT_ROOT=/var/www/app/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
|
|
|
|
RUN echo '<Directory /var/www/app/public>\n\
|
|
AllowOverride All\n\
|
|
Require all granted\n\
|
|
</Directory>' > /etc/apache2/conf-available/laravel.conf \
|
|
&& a2enconf laravel
|
|
|
|
COPY composer.json composer.lock ./
|
|
|
|
# Note: for Laravel, the COPY . . needs to be before the composer install
|
|
COPY . .
|
|
|
|
# Make sure the storage and cache directories exist and are writeable before running composer install
|
|
RUN mkdir -p \
|
|
storage/app \
|
|
storage/framework/cache/data \
|
|
storage/framework/sessions \
|
|
storage/framework/views \
|
|
storage/logs \
|
|
bootstrap/cache \
|
|
&& chown -R www-data:www-data storage bootstrap/cache \
|
|
&& chmod -R ug+rwX storage bootstrap/cache
|
|
|
|
RUN composer install \
|
|
--no-dev \
|
|
--prefer-dist \
|
|
--no-interaction \
|
|
--optimize-autoloader
|
|
|
|
EXPOSE 80
|