39 lines
1.0 KiB
Docker
39 lines
1.0 KiB
Docker
|
# Use the official PHP-FPM image as the base image
|
||
|
FROM php:8.1-fpm
|
||
|
|
||
|
# Install system dependencies
|
||
|
RUN apt-get update && apt-get install -y \
|
||
|
libpng-dev \
|
||
|
libjpeg-dev \
|
||
|
libfreetype6-dev \
|
||
|
libzip-dev \
|
||
|
unzip \
|
||
|
libcurl4-openssl-dev \
|
||
|
libonig-dev \
|
||
|
imagemagick \
|
||
|
libmagickwand-dev \
|
||
|
&& pecl install imagick \
|
||
|
&& docker-php-ext-enable imagick
|
||
|
# Remove xdebug later
|
||
|
|
||
|
# Install PHP extensions
|
||
|
RUN docker-php-ext-install gd pdo pdo_mysql zip curl mbstring xml
|
||
|
|
||
|
# Set the working directory in the container
|
||
|
WORKDIR /var/www/html
|
||
|
|
||
|
# Copy the Laravel application files to the container
|
||
|
COPY . .
|
||
|
|
||
|
# Install Composer (if you haven't installed it globally on your host machine)
|
||
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
||
|
|
||
|
# Install/update application dependencies using Composer
|
||
|
RUN composer update && composer install
|
||
|
|
||
|
# Expose port 9000 to connect to the PHP-FPM server
|
||
|
EXPOSE 9000
|
||
|
|
||
|
# Start PHP-FPM to serve the Laravel application
|
||
|
CMD ["php-fpm"]
|