This project demonstrates a simple PHP + MySQL web application running in Docker containers. It includes a registration form that saves user data to a MySQL database and displays all registered users.
- PHP 8.2 with Apache
- MySQL 8.0
- User registration form (name, email)
- Data is saved and displayed in a table
- phpMyAdmin for database management
- All services run via Docker Compose
php-mysql-docker/
├── docker-compose.yml
├── php/
│ ├── index.php
│ ├── process.php
├── sql/
│ └── init.sql
- Clone this repository:
git clone https://github.com/yourusername/php-mysql-docker.git cd php-mysql-docker
- Start the containers:
docker-compose up -d
- Open your browser and go to http://localhost:8080/php/index.php
- Access phpMyAdmin at http://localhost:8081 (user:
root
, password:root
)
docker-compose down
- Edit
php/index.php
andphp/process.php
for your PHP logic. - Edit
sql/init.sql
to change the initial database schema.
MIT