# .env (create this file in the same directory)
DB_NAME=mywebsite
DB_USER=webapp
DB_PASS=your_secure_password_here
MYSQL_ROOT_PASS=root_secure_password
Usage
# Start all services
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Reset database (warning: deletes all data)
docker-compose down -v && docker-compose up -d
What This Stack Includes
Service
Image
Purpose
Nginx
nginx:alpine
Web server and reverse proxy
PHP
php:8.2-fpm
PHP application server
MySQL
mysql:8.0
Relational database
Security Notes
Change default passwords in .env before deploying
MySQL port 3306 is not exposed externally by default (only accessible within Docker network)
Use the provided .envtemplate to manage secrets securely
For production, add a restart: always policy to each service