https://github.com/andrescdo/php-docker
This repository contains a Docker Compose setup for a PHP-Apache-MySQL environment.
https://github.com/andrescdo/php-docker
apache docker docker-compose mysql php
Last synced: 3 months ago
JSON representation
This repository contains a Docker Compose setup for a PHP-Apache-MySQL environment.
- Host: GitHub
- URL: https://github.com/andrescdo/php-docker
- Owner: AndresCdo
- Created: 2022-04-18T14:38:56.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T19:05:41.000Z (almost 2 years ago)
- Last Synced: 2025-10-29T07:33:36.013Z (8 months ago)
- Topics: apache, docker, docker-compose, mysql, php
- Language: Dockerfile
- Homepage:
- Size: 465 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PHP-Apache-MySQL Docker Environment
This repository contains a Docker Compose setup for a PHP-Apache-MySQL environment.
## Prerequisites
- Docker
- Docker Compose
## Getting Started
### Clone the Repository
```bash
git clone https://github.com/andrescdo/php-apache-mysql-docker.git
cd php-apache-mysql-docker
```
### Build and Start the Containers
```bash
docker-compose up -d
```
### Access the Application
- PHP-Apache [http://localhost:8080](http://localhost:8080).
- MySQL [http://localhost:8081](http://localhost:8081).
## Configuration
### PHP-Apache
The PHP-Apache server is configured to serve files from the `src` directory. You can place your PHP files in this directory.
### MySQL
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 the `root` 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.
## Cleanin Up
To stop and remove the containers, run the following command:
```bash
docker-compose down
```
To remove the MySQL data, run the following command:
```bash
rm -rf mysql/data
```
## License
This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).