This image was built based on the scripts that I have found at docker-alpine-micro , and with the help of his docker-utils script I was able to build my own image.
This is still new/simple docker image which will have:
- PHP7.x/8.x
- Nginx (with h5bp)
- zaherg/php-and-nginx:7.2 Not active any more
- zaherg/php-and-nginx:7.3 Not active any more
- zaherg/php-and-nginx:7.4
- zaherg/php-and-nginx:8.0
These images were also published to github packages
Latest will always be used with the latest PHP version
- Starting from 2020, We have removed
crond
andrsyslogd
and they wont be installed nor activated any more. - Also we removed xdebug as it is pointless to have it.
This is a sample docker file which is used to build Laravel Application
FROM zaherg/php-and-nginx:8.0
ENV APP_ENV production
COPY . /web/html
WORKDIR /web/html
RUN composer install --prefer-dist --no-ansi --no-interaction --no-scripts --no-progress --no-suggest --optimize-autoloader --no-dev \
&& sed -i 's/root \/web\/html;/root \/web\/html\/public;/' /etc/nginx/nginx.conf \
&& chgrp -R nobody /web/html/storage /web/html/bootstrap/cache \
&& chmod -R ug+rwx /web/html/storage /web/html/bootstrap/cache \
&& chown -R nginx /web/html/storage /web/html/bootstrap/cache
We copy the code to the /web/html
, since the root location for my web pages defined inside nginx configuration as
web/html
we run a small sed command to replace it with the root location for our Laravel application
sed -i 's/root \/web\/html;/root \/web\/html\/public;/' /etc/nginx/nginx.conf
Small note: The user we use here is root
feel free to change it.
You can manage Zend OPcache using the environment variables
PHP_OPCACHE_VALIDATE_TIMESTAMPS=0
PHP_OPCACHE_MAX_ACCELERATED_FILES=10000
PHP_OPCACHE_MEMORY_CONSUMPTION=192
PHP_OPCACHE_MAX_WASTED_PERCENTAGE=10
- Core
- ctype
- curl
- date
- dom
- fileinfo
- filter
- ftp
- hash
- iconv
- json
- libxml
- mbstring
- mysqlnd
- openssl
- pcre
- PDO
- pdo_sqlite
- Phar
- posix
- readline
- Reflection
- session
- SimpleXML
- SPL
- sqlite3
- standard
- tokenizer
- xml
- xmlreader
- xmlwriter
- zlib
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
FreeType Support => enabled
FreeType Linkage => with freetype
FreeType Version => 2.8.1
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.6.34
WBMP Support => enabled
XBM Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 1 => 1
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.