This repository contains a Docker Compose setup for a PHP-Apache-MySQL environment.
- Docker
- Docker Compose
git clone https://github.com/andrescdo/php-apache-mysql-docker.git
cd php-apache-mysql-docker
docker-compose up -d
- PHP-Apache http://localhost:8080.
- MySQL http://localhost:8081.
The PHP-Apache server is configured to serve files from the src
directory. You can place your PHP files in this directory.
The MySQL configuration file is located in ./mysql/my.cnf
. You can change the configuration in this file.
The MySQL server is configured with the following environment variables:
MYSQL_ROOT_PASSWORD
: The password for theroot
user.MYSQL_DATABASE
: The name of the default database.MYSQL_USER
: The name of the default user.MYSQL_PASSWORD
: The password for the default user.
You can change these values in the docker-compose.yml
file.
To stop and remove the containers, run the following command:
docker-compose down
To remove the MySQL data, run the following command:
rm -rf mysql/data
This project is open-sourced software licensed under the MIT license.