50 lines
1.2 KiB
Docker
50 lines
1.2 KiB
Docker
FROM php:8.3-fpm
|
|
|
|
# Install system dependencies & PHP extensions
|
|
RUN apt-get update && apt-get install -y \
|
|
libzip-dev \
|
|
unzip \
|
|
git \
|
|
libpq-dev \
|
|
libicu-dev \
|
|
zip \
|
|
curl \
|
|
&& docker-php-ext-install \
|
|
intl \
|
|
zip \
|
|
pdo_pgsql \
|
|
bcmath
|
|
|
|
# Install Composer
|
|
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www
|
|
|
|
# Copy source
|
|
COPY . .
|
|
COPY .env.example .env
|
|
|
|
# Set www-data user permission before running composer/install artisan
|
|
RUN chown -R www-data:www-data /var/www
|
|
|
|
USER www-data
|
|
|
|
# Install dependencies & generate app key as www-data user
|
|
RUN composer install --no-interaction --prefer-dist --optimize-autoloader \
|
|
&& php artisan key:generate
|
|
|
|
USER root
|
|
|
|
# Set permissions again just in case
|
|
RUN chown -R www-data:www-data /var/www/storage /var/www/bootstrap/cache \
|
|
&& chmod -R 775 /var/www/storage /var/www/bootstrap/cache
|
|
|
|
RUN chmod -R 777 /var/www
|
|
RUN sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/8.3/fpm/php.ini
|
|
RUN sed -i 's/display_errors = Off/display_errors = On/g' /etc/php/8.3/cli/php.ini
|
|
RUN sed -i 's/error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT/error_reporting = E_ALL/g' /etc/php/8.3/fpm/php.ini
|
|
|
|
EXPOSE 9000
|
|
CMD ["php-fpm"]
|