feat(docker): add docker-compose.yml, Dockerfile
Signed-off-by: miguel456 <me@nogueira.codes>
This commit is contained in:
38
Dockerfile
Normal file
38
Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
# 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"]
|
Reference in New Issue
Block a user