๐ A simple PHP environment with Docker for local development.
# install docker-php
# (not npm, npx!)
npx docker-php@latest
# start the PHP server on port 3200
# (http://localhost:3200/)
npm run php
Will add all the necessary configurations to your npm project for running your PHP code locally:
- Adds a
docker
folder withDockerfile
anddocker-compose
. - Adds some useful scripts to your
package.json
file. - Adds
/src/index.php
(if it does not already exist).
-
Deploy with
docker-compose
:
How to deploy on remote Docker hosts with docker-compose -
Want to use
docker stack deploy
? (recommended)
https://docs.docker.com/engine/swarm/stack-deploy/