All Projects → formapro → docker-nginx-php-fpm

formapro / docker-nginx-php-fpm

Licence: MIT License
A php-fpm and nginx docker image.

Programming Languages

Smarty
1635 projects
shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to docker-nginx-php-fpm

concerto
A command line tool and a library to generate TLS certificates for development purposes.
Stars: ✭ 34 (+30.77%)
Mutual labels:  https
hyper-tunnel
HTTPS tunnel over WSS
Stars: ✭ 15 (-42.31%)
Mutual labels:  https
client
Remote access and tunnels to your localhost from everywhere in the world.
Stars: ✭ 25 (-3.85%)
Mutual labels:  https
wumpfetch
🚀🔗 A modern, lightweight, fast and easy to use Node.js HTTP client
Stars: ✭ 20 (-23.08%)
Mutual labels:  https
HAProxy-2-RPM-builder
Build latest HAProxy binary with prometheus metrics support
Stars: ✭ 28 (+7.69%)
Mutual labels:  https
reserve
Lightweight http server statically configurable using regular expressions
Stars: ✭ 19 (-26.92%)
Mutual labels:  https
website-checks
check your website for issues with multiple tools and get PDF reports of the results
Stars: ✭ 69 (+165.38%)
Mutual labels:  https
iyov
Web proxy for http(s) for developers to analyze data between client and servers based on workerman, especailly for app developers.
Stars: ✭ 27 (+3.85%)
Mutual labels:  https
hpagent
A ready to use http and https agent for working with proxies that keeps connections alive!
Stars: ✭ 86 (+230.77%)
Mutual labels:  https
ipns-link
Expose local http-server (web-app) through IPNS
Stars: ✭ 18 (-30.77%)
Mutual labels:  https
flareon
🦊A cloudflare DNS over HTTPs resolver client library.
Stars: ✭ 14 (-46.15%)
Mutual labels:  https
jota-cert-checker
Check SSL certificate expiration date of a list of sites.
Stars: ✭ 45 (+73.08%)
Mutual labels:  https
HTTP-Connectivity-Tester
Aids in discovering HTTP and HTTPS connectivity issues. #nsacyber
Stars: ✭ 79 (+203.85%)
Mutual labels:  https
lambda-redirector
Redirect an entire website using AWS Lambda
Stars: ✭ 21 (-19.23%)
Mutual labels:  https
Kvpbase
Scalable, simple RESTful object storage platform, written in C#
Stars: ✭ 43 (+65.38%)
Mutual labels:  https
plex-traefik
Plex media server with traefik 2 in docker and docker-compose
Stars: ✭ 30 (+15.38%)
Mutual labels:  https
gost
GO Simple Tunnel - a simple tunnel written in golang
Stars: ✭ 154 (+492.31%)
Mutual labels:  https
Go-Small-Docker-Image
Creating a smaller golang docker image
Stars: ✭ 32 (+23.08%)
Mutual labels:  docker-image
hypercorn-fastapi-docker
Docker image with Hypercorn for FastAPI apps in Python 3.7, 3.8, 3.9. Ready for HTTP2 and HTTPS
Stars: ✭ 18 (-30.77%)
Mutual labels:  https
node-jsonrpc2
JSON-RPC 2.0 server and client library, with HTTP (with Websocket support) and TCP endpoints
Stars: ✭ 103 (+296.15%)
Mutual labels:  https

docker-nginx-php-fpm

Usage

Let's say you have /home/user/app/web folder which web root of your project. If the file physically exists on filesystem it is served by nginx. If file not present Nginx proxy a request to PHP-FPM. There must be a app.php inside the folder.

echo "<?php phpinfo();" > app.php
echo "<h1>Hello world</h1>" > hello.html

docker run -d -p 8080:80 -v `pwd`:/var/www/html formapro/nginx-php-fpm

curl -X GET localhost:8080 # runs app.php and outputs phpinfo
curl -X GET localhost:8080/hello.html # shows Hello world

Env vars

Here's available env vars and their default values:

NGINX_WEB_ROOT=     /var/www/html
NGINX_PHP_FALLBACK= /index.php
NGINX_PHP_LOCATION= ^/index\.php(/|$$)
NGINX_USER=         www-data
NGINX_CONF=         /etc/nginx/nginx.conf

PHP_SOCK_FILE=      /run/php.sock
PHP_USER=           www-data
PHP_GROUP=          www-data
PHP_MODE=           0660
PHP_FPM_CONF=       /etc/php/7.0/fpm/php-fpm.conf

XDebug on Mac

  • To enable xdebug mount xdebug configuration file to: /etc/php/7.0/mods-available/xdebug.ini
  • Set fake ip on the docker host: sudo ifconfig lo0 alias 172.10.0.1
  • For PHPStorm set container env: PHP_IDE_CONFIG: 'serverName=server.loc' where 'server.loc' - PHPStorm server name
; xdebug.ini
zend_extension=xdebug.so
xdebug.profiler_enable = Off
xdebug.profiler_enable_trigger = Off
xdebug.max_nesting_level = 5000
xdebug.remote_enable = On
xdebug.remote_host = 172.10.0.1

Enable HTTPS

Use it only locally.

Generate self-signed certificates:

openssl req -newkey rsa:2048 -sha256 -nodes -keyout YOURPRIVATE.key -x509 -days 365 -out YOURPUBLIC.pem -subj "/C=US/ST=New York/L=Brooklyn/O=Example Brooklyn Company/CN=YOURDOMAIN.EXAMPLE"

Run container with additional env vars:

docker run -d -p443:443 -v `pwd`:/var/www/html -e NGINX_SSL_PUBLIC_CERTIFICATE=/var/www/html/YOURPUBLIC.pem -e NGINX_SSL_PRIVATE_CERTIFICATE=/var/www/html/YOURPRIVATE.key formapro/nginx-php-fpm:latest

curl https://localhost:443 --insecure

Developed by Forma-Pro

Forma-Pro is a full stack development company which interests also spread to open source development. Being a team of strong professionals we have an aim an ability to help community by developing cutting edge solutions in the areas of e-commerce, docker & microservice oriented architecture where we have accumulated a huge many-years experience. Our main specialization is Symfony framework based solution, but we are always looking to the technologies that allow us to do our job the best way. We are committed to creating solutions that revolutionize the way how things are developed in aspects of architecture & scalability.

If you have any questions and inquires about our open source development, this product particularly or any other matter feel free to contact at [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].