This project provides a ready-to-use Docker Compose environment for running WordPress with MySQL and Nginx.
wp-docker/
├── app/
│ ├── sql/
│ │ └── init.sh # MySQL initialization script
│ └── src/
│ └── wp-config.php # WordPress configuration
├── nginx-conf/
│ └── nginx.conf # Nginx server configuration
├── docker-compose.yml # Docker Compose setup
-
Clone the repository
git clone https://github.com/ramkumar2098/wp-docker cd wp-docker -
Create environment files
- Copy the sample environment files:
cp .env.sample.php .env.php cp .env.sample.mysql .env.mysql
- Edit
.env.phpand.env.mysqlto set your own credentials and secrets.
Note: The
.env.sample.phpand.env.sample.mysqlfiles contain example values for MySQL and WordPress configuration. You must update these values for your local setup. Make sure to generate and set strong WordPress salts and keys in your.env.phpfile. - Copy the sample environment files:
-
Start the services
docker compose up -d
-
Access WordPress
- Open http://localhost:8080 in your browser.
docker compose down- If you encounter permission issues, try running Docker commands with
sudo. - Ensure ports 8080 (Nginx) and 3306 (MySQL) are not in use by other services.
- Check logs with
docker compose logsfor more details.
MIT © 2025
View LICENSE