Skip to content
Nginx PHP7 for Docker
Dockerfile HTML Shell PHP
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example update readme for thanks jetbrains Sep 12, 2019
vhost update dockerfile Sep 3, 2019
www update nginx 1.17.4 Sep 25, 2019
.gitignore update php to version 7.2.13 Dec 23, 2018
Dockerfile Update php7.3.12&nginx1.17.6 Nov 22, 2019
LICENSE
README.md Update php7.3.12&nginx1.17.6 Nov 22, 2019
README_CN.md Update php7.3.12&nginx1.17.6 Nov 22, 2019
entrypoint.sh update php7.3.9 Sep 3, 2019
nginx.conf

README.md

Nginx and PHP7.3 for Docker

English | 简体中文

Last Version

NGINX: 1.17.6
PHP: 7.3.12

PHP 7.2. plesae visit v2 branch.

Docker Hub

Nginx-PHP7: https://hub.docker.com/r/skiychan/nginx-php7

Example

Build

git pull origin https://github.com/skiy/nginx-php7.git
cd nginx-php7
docker build -t nginx-php7 .

Installation

Pull the image from the docker index rather than downloading the git repo. This prevents you having to build the image on every docker host.

docker pull skiychan/nginx-php7:latest

To pull the Nightly Version:

docker pull skiychan/nginx-php7:nightly

Running

To simply run the container:

docker run --name nginx -p 8080:80 -d skiychan/nginx-php7

You can then browse to http://\<docker_host\>:8080 to view the default install files.

Volumes

If you want to link to your web site directory on the docker host to the container run:

docker run --name nginx -p 8080:80 -v /your_code_directory:/data/wwwroot -d skiychan/nginx-php7
More
docker run --name nginx -p 8080:80 \
-v /your_code_directory:/data/wwwroot \
-v /your_nginx_log_path:/data/wwwlogs \
-v /your_nginx_conf_path:/data/server/nginx \
-v /your_php_extension_ini:/data/server/php/ini \
-v /your_php_extension_file:/data/server/php/extension \
-d skiychan/nginx-php7

Enabling Extensions With Source

Add ext-xxx.ini to folder /your_php_extension_ini, source /your_php_extension_file. then run the command:

docker run --name nginx \
-p 8080:80 -d \
-v /your_php_extension_ini:/data/server/php/ini \
-v /your_php_extension_file:/data/server/php/extension \
skiychan/nginx-php7

/your_php_extension_ini/ext-xxx.ini file content:

extension=mongodb.so

/your_php_extension_file/extension.sh file content:

curl -Lk https://pecl.php.net/get/mongodb-1.4.2.tgz | gunzip | tar x -C /home/extension && \
cd /home/extension/mongodb-1.4.2 && \
/usr/local/php/bin/phpize && \
./configure --with-php-config=/usr/local/php/bin/php-config && \
make && make install

Author

Author: Skiychan
Email: dev@skiy.net
Link: https://www.skiy.net

Thanks

JetBrains

You can’t perform that action at this time.