Files
merchbay/Dockerfile
franknstayn eb1547626f updated
2023-08-28 03:49:43 +08:00

47 lines
1.1 KiB
Docker

# Use the official PHP image based on Alpine Linux
FROM php:5.6-fpm-alpine
# Install system dependencies and PHP extensions
RUN apk --update --no-cache add \
php5.6-fpm \
nginx \
libpng-dev \
libjpeg-turbo-dev \
freetype-dev \
libzip-dev \
zip \
unzip \
libmcrypt-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install gd pdo pdo_mysql zip mcrypt
# Set the working directory in the container
WORKDIR /var/www/html
# Copy Nginx config
COPY default.conf /etc/nginx/conf.d/default.conf
# Copy the Laravel application files to the container
COPY . .
# Set appropriate permissions for Laravel storage and bootstrap cache
RUN chown -R www-data:www-data storage bootstrap
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
# Install Laravel dependencies
RUN composer install
# Generate Laravel application key
RUN php artisan key:generate
# Expose port 9000 for PHP-FPM
EXPOSE 80
EXPOSE 9001
# Start PHP-FPM
CMD service php5.6-fpm start && nginx -g "daemon off;"