This is my standard way of spinning up a PHP/NGINX docker environment to develop with including running PHP scripts on command line through docker
[TOC]
Place your site files into /site
Create a .env file in the root containing values for the following keys (minimum).
DB_ROOT_PASS
DB_APP_NAME
DB_APP_USER
DB_APP_PASS
These allow for a script to be run on the command line. ./cli
and ./cli2
are identical except for docker container name - it's to allow multiple cli scripts to be run simultaneously.
./cli [any php script here]
Down's the entire docker stack and removes the container using docker stop
and docker rm
./login [docker container name]
allows you to log into the container running on a given name. useful only for debugging weird issues.
a shortcut to docker-compose logs -f
- used to view follow log entries coming from the docker containers.
Brings the entire docker dev stack up.