Generate an image in 2 or more stages if necessary.
First stage, compile PHP-FPM 7.0.33 with all the most commonly used modules, including Zend OpCache and PHP-FPM. To achieve this, use alpine:3.16 as the base image.
Second stage, copy all the necessary packages, binaries, and configuration files for PHP-FPM to function correctly. Additionally, install Nginx, along with php.ini, nginx.conf, and php-fpm.conf configurations set for high performance. For this second stage, use alpine:latest as the base image.
Achieve an optimized and lightweight image, ready to deploy a PHP project developed in Codeigniter 3 framework, located in the "app" folder.
Generate each of the files with their corresponding configurations, so that I can deploy my PHP project without any issues. Dockerfile, nginx.conf, php-fpm.conf, and php.ini. There should be exactly 4 paragraphs separated by the markdown divider: ***.
user