A repository containing the Docker files to build a LAMP stack which I use for local development on macOS.
This is based on a workshop given by Dana Luther. From that I have written a tutorial for installing Apache, MySQL, and PHP on macOS using Docker.
If you're just getting started with Docker, I recommend following the tutorial. Otherwise, if you are a welcome to review the notes below.
While I use this for development on macOS, you may use this for any platform. To being, install the Docker Desktop Client.
- php:7.4-apache
- mysql:latest
- composer:2
- phpmyadmin/phpmyadmin:latest
To pre-download the underlying images, use the docker pull command:
docker pull php:7.4-apache
docker pull mysql:latest
docker pull composer:2docker image build --no-cache -f images/Dockerfile-php-apache -t lamp .docker stack deploy -c docker-compose.yml devdocker stack rm devdocker volume create workspace --opt type=none --opt device=/Users/jasonmccreary/workspace --opt o=bind
docker volume create data --opt type=none --opt device=/Users/jasonmccreary/data --opt o=bindSince the MySQL data directory is configured to persist, this only needs to be run once per initial setup.
GRANT ALL PRIVILEGES ON *.* TO 'dbuser'@'%';Note: This user has access from any IP to avoid additional network configuration.