Skip to content

amiano4/docker-dev-env

 
 

Repository files navigation

Docker with PHP 8.3.4 and MySQL 8

Web development environment setup for UNIX.

To use the PHP Executable from the Docker Container

  1. Find the PHP path inside the docker container
docker exec -it docker.php bash
which php
  1. Create a wrapper script docker-php to run PHP commands via docker
# for example: the current PATH is /usr/local/bin
sudo nano /usr/local/bin/docker-php
  1. Add the following code
#!/bin/bash
docker compose exec docker.php php "$@"
  1. Make the script executable
sudo chmod +x /usr/local/bin/docker-php
  1. Use the new script to run PHP commands in your machine
docker-php -v
docker-php -r 'echo "Hello from Docker PHP!\n";'

About

Flexible environment for web development with docker.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 96.0%
  • Shell 2.6%
  • PHP 1.4%