You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.5 KiB
55 lines
1.5 KiB
FROM php:8.2-fpm-alpine AS base |
|
|
|
RUN apk add --no-cache \ |
|
icu-dev \ |
|
libzip-dev \ |
|
libpng-dev \ |
|
jpeg-dev \ |
|
freetype-dev \ |
|
&& docker-php-ext-install \ |
|
intl \ |
|
pdo_mysql \ |
|
zip \ |
|
gd |
|
RUN docker-php-ext-configure gd --with-freetype --with-jpeg \ |
|
&& docker-php-ext-configure pcntl --enable-pcntl \ |
|
&& docker-php-ext-install pcntl |
|
|
|
RUN echo "memory_limit = 256M" > /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "upload_max_filesize = 100M" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "post_max_size = 100M" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "max_execution_time = 300" >> /usr/local/etc/php/conf.d/custom.ini \ |
|
&& echo "user = www-data" >> /usr/local/etc/php-fpm.d/www.conf \ |
|
&& echo "group = www-data" >> /usr/local/etc/php-fpm.d/www.conf \ |
|
&& echo "listen.owner = www-data" >> /usr/local/etc/php-fpm.d/www.conf \ |
|
&& echo "listen.group = www-data" >> /usr/local/etc/php-fpm.d/www.conf |
|
|
|
WORKDIR /var/www/html |
|
|
|
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer |
|
|
|
|
|
########################## |
|
# PHP-FPM stage |
|
FROM base AS php-fpm |
|
|
|
COPY docker/entrypoint.sh /entrypoint.sh |
|
RUN chmod +x /entrypoint.sh |
|
|
|
# Expose port 9000 for PHP-FPM |
|
EXPOSE 9000 |
|
|
|
ENTRYPOINT [ "/entrypoint.sh" ] |
|
|
|
CMD ["php-fpm"] |
|
|
|
|
|
########################## |
|
# Nginx stage - final nginx image |
|
FROM nginx:alpine AS nginx |
|
|
|
COPY docker/default.conf /etc/nginx/conf.d/default.conf |
|
|
|
EXPOSE 80 |
|
|
|
CMD ["nginx", "-g", "daemon off;"] |