{"id":20252466,"url":"https://github.com/ivandotv/docker-wordpress-image","last_synced_at":"2026-05-09T07:36:23.741Z","repository":{"id":98901960,"uuid":"235183642","full_name":"ivandotv/docker-wordpress-image","owner":"ivandotv","description":"Docker WordPress images for easy development and production","archived":false,"fork":false,"pushed_at":"2023-12-15T08:59:53.000Z","size":12,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-02T15:06:19.832Z","etag":null,"topics":["docker","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/ivandotv.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}},"created_at":"2020-01-20T19:39:00.000Z","updated_at":"2023-08-07T04:35:34.000Z","dependencies_parsed_at":"2023-12-15T09:48:24.975Z","dependency_job_id":null,"html_url":"https://github.com/ivandotv/docker-wordpress-image","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ivandotv/docker-wordpress-image","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fdocker-wordpress-image","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fdocker-wordpress-image/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fdocker-wordpress-image/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fdocker-wordpress-image/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ivandotv","download_url":"https://codeload.github.com/ivandotv/docker-wordpress-image/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ivandotv%2Fdocker-wordpress-image/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32811653,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["docker","wordpress"],"created_at":"2024-11-14T10:16:56.070Z","updated_at":"2026-05-09T07:36:23.716Z","avatar_url":"https://github.com/ivandotv.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WordPress images for development and production\n\nThese images are built from the official WordPress `PHP-fpm` images, with some added functionality (script hooks).\n\nAll images come bundled with:\n\n- `git`\n- `unzip`\n- `wp-cli` (with bash completion)\n- `sudo` (for operating wp-cli as `www-data` user)\n\nDevelopment images come with:\n\n- `xdebug` installed\n- `opcache` disabled\n\nImages with tags that end with `-dev` are created for development purposes.\nImages that end with `-prod` should be used in production. You should use the `base` image only for building other images (upstream).\n\n## Usage\n\nMount `host_directory` to hold WordPress installation and be accessible from the outside.\n\n`docker run -v host_directory:/var/www/html ivandotv/wordpress`\n\nMount only your theme\n\n`docker run -v your-theme:/var/www/html/wp-content/themes/your-theme ivandotv/wordpress`\n\nRun [wp cli info](https://developer.wordpress.org/cli/commands/cli/info/) command on already running container.\n\n`docker exec -it ivandotv/WordPress wp cli info`\n\nThe default working directory inside the container is `/var/www/html` (WordPress installation) so this is where the call to `wp cli` is going to be executed.\n\n## `WP_ENV` variable\n\nIn `-dev` version of images `WP_ENV` variable is set to `development`, this variable can be overwritten.\nWhen container is running in `development` mode:\n\n- `WP_DEBUG` is set to `true`\n- `WP_DEBUG_LOG` is set to `true`\n- `php` file is added to the root of the installation `var/www/html/phpinfo.php` with `phpinfo();` function\n\nIn `-prod` version of images `WP_ENV` is set to `production`.\nWhen the container is running in `production`:\n\n- `WP_DEBUG` is set to `false`\n- `WP_DEBUG_LOG` is set to `false`\n- `php` file is removed from the root of the installation\n\n## WP-CLI\n\n[`WP-CLI`](https://wp-cli.org/) is installed in all images (including bash completion) and it is set up to run as `www-data` user.\n\n`docker exec -it ivandotv/WordPress wp cli info`\n\n## Custom Script Hooks\n\nAll images can execute script **_before_** and **_after_** Wordpress installation, and **EVERY** time the container is **_started_**.\n\nTo run the scripts, you need to make them available to the container by mounting the directory with the scripts to the `/etc/wp-config` directory inside the container.\n\n`docker run -it -v host_scripts_dir:/etc/wp-config ivandotv/wordpress`\n\nSo, in `host_scripts_dir` container will look for these scripts:\n\n- `before_install.sh` the script is run **before installing** Wordpress if the installation is successful, this script will not be run again when the container is restarted.\n- `after_install.sh` the script is run **after installing** Wordpress and only if the installation is successful, this script will not be run again when the container is restarted.\n\n- `start.sh` script is run **every time** the container is started (created/restarted).\n\n## Configuring and Installing WordPress\n\nOriginal (upstream) image just copies WordPress files in the `/var/www/html` directory then `wp-cli` takes over and first, creates the configuration file (`wp-config.php`) then, installs WordPress.\n\n### Creating wp-config.php file\n\n`wp-config.php` file is created with [`wp config create`](https://developer.wordpress.org/cli/commands/config/create/) command, you can modify the parameter values that are used for the command via environment variables.\n\n```bash\n# default configuration for creating config.php\n\n# db name\nWP_CLI_DB_NAME=\"${WP_CLI_DB_NAME:-wordpress}\"\n# db user\nWP_CLI_DB_USER=\"${WP_CLI_DB_USER:-admin}\"\n# db passowd\nWP_CLI_DB_PASS=\"${WP_CLI_DB_PASS:-admin}\"\n# db host ( db container)\nWP_CLI_DB_HOST=\"${WP_CLI_DB_HOST:-localhost}\"\n# db prefix\nWP_CLI_DB_PREFIX=\"${WP_CLI_DB_PREFIX:-wp_}\"\n# db charset\nWP_CLI_DB_CHARSET=\"${WP_CLI_DB_CHARSET:-ut8}\"\n# skip checking for the database connection if \"true\"\nWP_CLI_DB_SKIP_CHECK=\"${WP_CLI_DB_SKIP_CHECK:-true}\"\n```\n\n### Install Wordpress\n\nWordpress is installed via [wp core install](https://developer.wordpress.org/cli/commands/core/install/) command, you can modify the parameter values for the command via environment variables. **Please note that you will need a database connection** to install WordPress. Take a look at this [docker-compose](todo) file.\n\n```bash\n# default WordPress installation parameters\n\n# address of the site\nWP_CLI_URL=\"${WP_CLI_URL:-http://localhost}\"\n# title of the site\nWP_CLI_TITLE=\"${WP_CLI_TITLE:-Example}\"\n# admin username\nWP_CLI_ADMIN_USER=\"${WP_CLI_ADMIN_USER:-admin}\"\n# admin password\nWP_CLI_ADMIN_PASSWORD=\"${WP_CLI_ADMIN_PASSWORD:-admin}\"\n#admin  email\nWP_CLI_ADMIN_EMAIL=\"${WP_CLI_ADMIN_EMAIL:-admin@example.com}\"\n# skip sending email to admin if \"true\"\nWP_CLI_ADMIN_SKIP_EMAIL=\"${WP_CLI_ADMIN_SKIP_EMAIL:-true}\"\n\n```\n\n## Building the Images\n\nYou can build all images by running `build.sh` script.\nImages are tagged by using the `tags.txt` file.\n\nfor example:\n\n`tags/php7.4/fpm-base=php7.4-fpm-base`\n\nThe previous line of code will tag the image that is built from the docker file located in `tags/php7.4/fpm-base` with the tag `php7.4-fpm-base` (equals sign splits dir/tag)\n\nIf the line starts with the `!` that image/tag will also be tagged as `latest`\n\n`!tags/php7.4/fpm-base=php7.4-fpm-base`\n\n## Docker Compose Demo\n\nTake a look at [this](todo) repository for the docker compose setup.\n\n- link to docker-compose setup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivandotv%2Fdocker-wordpress-image","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fivandotv%2Fdocker-wordpress-image","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fivandotv%2Fdocker-wordpress-image/lists"}