Local PHP dev environment with NGINX, PHP & MYSQL inside of Docker.
-
Rename
.env.example
to.env
and give the variables a value -
(Optional) Generate tls certificates by running
sudo ./gencerts.sh
-
Run
docker-compose up --build
to run the containers and build the custom PHP image. -
Once containers are up, visit http://127.0.0.1 in your browser. If everything went okay, you should connect to the MySQL database automatically and view PHP info!
- Added SSL/TLS support
- Env variables passed to PHP container so it can connect to MYSQL without hardcoding credentials
- Thanks to https://techsparx.com/software-development/docker/damp/mysql-ssl-connection.html for the generate certs scripts.