Docker_Laravel/Dockerfile

28 lines
613 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
# Expose port
EXPOSE 9000
CMD ["php-fpm"]