{"id":29353703,"url":"https://github.com/basemax/docker-wordpress-easy-to-run","last_synced_at":"2025-07-09T02:08:59.475Z","repository":{"id":303106846,"uuid":"1014412377","full_name":"BaseMax/docker-wordpress-easy-to-run","owner":"BaseMax","description":"A production-ready Docker setup for running WordPress with support for ionCube and SourceGuardian loaders. Built on top of the official wordpress image.","archived":false,"fork":false,"pushed_at":"2025-07-05T19:05:22.000Z","size":69,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-05T19:06:33.803Z","etag":null,"topics":["compose-docker","docker","docker-compose","docker-php","docker-wp","php","php-docker","wp","wp-docker"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BaseMax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-05T17:11:58.000Z","updated_at":"2025-07-05T19:05:25.000Z","dependencies_parsed_at":"2025-07-05T19:06:37.788Z","dependency_job_id":"cca7be69-cc14-4263-ae35-29e80edd6782","html_url":"https://github.com/BaseMax/docker-wordpress-easy-to-run","commit_stats":null,"previous_names":["basemax/docker-wordpress-easy-to-run"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BaseMax/docker-wordpress-easy-to-run","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fdocker-wordpress-easy-to-run","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fdocker-wordpress-easy-to-run/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fdocker-wordpress-easy-to-run/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fdocker-wordpress-easy-to-run/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BaseMax","download_url":"https://codeload.github.com/BaseMax/docker-wordpress-easy-to-run/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BaseMax%2Fdocker-wordpress-easy-to-run/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264379216,"owners_count":23598824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["compose-docker","docker","docker-compose","docker-php","docker-wp","php","php-docker","wp","wp-docker"],"created_at":"2025-07-09T02:08:58.585Z","updated_at":"2025-07-09T02:08:59.467Z","avatar_url":"https://github.com/BaseMax.png","language":"PHP","readme":"# 🐳 docker-wordpress-easy-to-run\n\nA production-ready Docker setup for running WordPress with support for **ionCube** and **SourceGuardian** loaders.  \nBuilt on top of the official [`wordpress`](https://hub.docker.com/_/wordpress) image.\n\n---\n\n## 🚀 Features\n\n- ✅ WordPress with PHP 8.1\n- ✅ Auto-install of [ionCube](https://basemax.github.io/ioncube-loaders-linux-x86-64/data.json) \u0026 [SourceGuardian](https://basemax.github.io/sourceguardian-loader-linux-x86-64/data.json) loaders via GitHub-hosted JSON\n- ✅ MariaDB for local development\n- ✅ Clean and minimal\n- ✅ Simple multi-site setup using shared template and per-site env configs\n\n![Docker Wordpress](wp.jpg)\n\n---\n\n## 📂 Folder Structure\n\n```\ndocker-wordpress-easy-to-run/\n├── template/                  # Shared Dockerfile, docker-compose.yml, and setup scripts\n│   ├── Dockerfile\n│   ├── docker-compose.yml\n│   ├── setup-loaders.php\n│   ├── setup-php.ini\n│   └── setup-wp-content.sh\n├── sites/                     # Multiple WordPress sites, each with own data \u0026 config\n│   ├── site1/\n│   │   ├── data/              # Database volume data for site1\n│   │   ├── root/              # WordPress root files overrides for site1 (optional)\n│   │   ├── wp-content/        # Themes, plugins, uploads for site1\n│   │   └── .env               # Environment variables for site1\n│   └── site2/\n│       ├── data/\n│       ├── root/\n│       ├── wp-content/\n│       └── .env\n├── update.bat                 # Batch script to update all sites\n├── update.sh                  # Bash script to update all sites\n├── LICENSE\n├── README.md\n└── wp.jpg                    # Screenshot/example image\n````\n\n---\n\n## ⚙️ Example `.env` file (per site)\n\n```env\nPROJECT_NAME=site1\nWP_PORT=9876\nPMA_PORT=9877\n\nDATABASE_NAME=wordpress\nDATABASE_USER=wordpress\nDATABASE_PASSWORD=wordpress\nDATABASE_ROOT_PASSWORD=root\n\nPHP_VERSION=8.1\n````\n\n---\n\n## ▶️ How to Run Multiple Sites\n\nRun each site from the main folder using:\n\n```bash\ndocker compose -p site1 --env-file sites/site1/.env -f template/docker-compose.yml up -d --build\ndocker compose -p site2 --env-file sites/site2/.env -f template/docker-compose.yml up -d --build\n```\n\nYou can also use the provided scripts `update.bat` (Windows) or `update.sh` (Linux/macOS) to automatically build and start all sites under `sites/`.\n\n---\n\n## 📋 Managing Individual Sites\n\n### View logs for a site\n\n```bash\ndocker compose -p site1 --env-file sites/site1/.env -f template/docker-compose.yml logs -f\n````\n\n### Stop and remove containers (keep database data)\n\n```bash\ndocker compose -p site1 --env-file sites/site1/.env -f template/docker-compose.yml down\n```\n\n### Stop and remove containers and volumes (deletes database and cache)\n\n```bash\ndocker compose -p site1 --env-file sites/site1/.env -f template/docker-compose.yml down -v\n```\n\nAlso, manually delete the `sites/site1/data/` folder to fully remove database files.\n\n### Start or rebuild a site\n\n```bash\ndocker compose -p site1 --env-file sites/site1/.env -f template/docker-compose.yml up -d --build\n```\n\n---\n\n### Note on your Errors:\n\n- `docker compose logs` needs to be run **where your docker-compose.yml file is located or you must pass `-f \u003cfile\u003e` correctly.**\n\n- The `-p` (project name) flag must be **before** the command and **before** `-f`. Correct syntax:\n\n```bash\ndocker compose -p site1 --env-file sites/site1/.env -f template/docker-compose.yml logs -f\n````\n\n(not after `logs -f`)\n\n### Export SQL Database from a Site\n\nRun this command to export the database from the site’s MariaDB container to a `.sql` file on your host machine:\n\n```bash\ndocker exec -i ${PROJECT_NAME}-db mysqldump -u${DATABASE_USER} -p${DATABASE_PASSWORD} ${DATABASE_NAME} \u003e ${PROJECT_NAME}_backup.sql\n```\n\nExample for `site1` (run from your main folder):\n\n```bash\ndocker exec -i site1-db mysqldump -uwordpress -pwordpress wordpress \u003e site1_backup.sql\n```\n\nThis will create `site1_backup.sql` with a full SQL dump of the WordPress database.\n\n---\n\n### Open Bash Shell Inside WordPress or Database Container\n\nSometimes you want to enter the container shell for debugging or manual operations.\n\n* Enter WordPress app container bash:\n\n```bash\ndocker exec -it ${PROJECT_NAME}-app bash\n```\n\nExample for `site2`:\n\n```bash\ndocker exec -it site2-app bash\n```\n\n* Enter MariaDB container shell (MySQL client):\n\n```bash\ndocker exec -it ${PROJECT_NAME}-db bash\n```\n\nThen inside the container:\n\n```bash\nmysql -u${DATABASE_USER} -p${DATABASE_PASSWORD} ${DATABASE_NAME}\n```\n\nExample:\n\n```bash\ndocker exec -it site1-db bash\nmysql -uwordpress -pwordpress wordpress\n```\n\n---\n\n### Import SQL Dump into Database\n\nIf you have an SQL dump file and want to restore it into the database container, use this:\n\n```bash\ndocker exec -i ${PROJECT_NAME}-db mysql -u${DATABASE_USER} -p${DATABASE_PASSWORD} ${DATABASE_NAME} \u003c /path/to/your_dump.sql\n```\n\nExample (assuming your SQL dump is `site1_backup.sql` in your current folder):\n\n```bash\ncat site1_backup.sql | docker exec -i site1-db mysql -uwordpress -pwordpress wordpress\n```\n\nThis pipes the SQL file into the container's MySQL client and restores the database.\n\n---\n\n### Summary Command Examples for `site1`\n\n```bash\n# Export DB\ndocker exec -i site1-db mysqldump -uwordpress -pwordpress wordpress \u003e site1_backup.sql\n\n# Enter WordPress app container shell\ndocker exec -it site1-app bash\n\n# Enter DB container shell \u0026 MySQL client\ndocker exec -it site1-db bash\nmysql -uwordpress -pwordpress wordpress\n\n# Import DB dump back to container\ncat site1_backup.sql | docker exec -i site1-db mysql -uwordpress -pwordpress wordpress\n```\n\n---\n\n## 🧠 Tips\n\n* Use `sites/siteX/wp-content/` to mount themes, plugins, and uploads per site\n* Use `sites/siteX/root/` to mount root of WordPres\n* Store database files under `sites/siteX/data/` to persist DB data per site\n* Modify `.env` in each site folder to configure ports, DB credentials, and PHP version\n* Always back up your `data/` folders to avoid losing database content\n\n---\n\n## 📄 License\n\nMIT License\n\nCopyright 2025, Seyyed Ali Mohammadiyeh (Max Base)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fdocker-wordpress-easy-to-run","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbasemax%2Fdocker-wordpress-easy-to-run","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbasemax%2Fdocker-wordpress-easy-to-run/lists"}