31 lines
715 B
Docker
31 lines
715 B
Docker
FROM php:8.2-fpm
|
|
|
|
# Install dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
libpng-dev \
|
|
libjpeg-dev \
|
|
libfreetype6-dev \
|
|
zip \
|
|
unzip \
|
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
|
&& docker-php-ext-install gd pdo pdo_mysql
|
|
|
|
# Install Composer
|
|
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
|
|
|
|
# Set working directory
|
|
WORKDIR /var/www/html
|
|
|
|
# Copy the application code
|
|
COPY . .
|
|
|
|
# Install Laravel dependencies
|
|
RUN composer install --no-dev --optimize-autoloader
|
|
|
|
# Set permissions
|
|
RUN chown -R www-data:www-data /var/www/html/storage /var/www/html/bootstrap/cache
|
|
|
|
# Expose port
|
|
EXPOSE 9000
|
|
|
|
CMD ["php-fpm"] |