{"id":21939202,"url":"https://github.com/grottopress/wordpress-dev","last_synced_at":"2026-04-02T04:47:39.807Z","repository":{"id":85788288,"uuid":"161084183","full_name":"GrottoPress/wordpress-dev","owner":"GrottoPress","description":"A WordPress development environment using docker","archived":false,"fork":false,"pushed_at":"2023-04-11T16:10:16.000Z","size":27,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T14:49:09.846Z","etag":null,"topics":["docker","docker-compose","wordpress","wordpress-docker"],"latest_commit_sha":null,"homepage":"","language":null,"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/GrottoPress.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":"2018-12-09T21:44:11.000Z","updated_at":"2023-04-10T16:26:51.000Z","dependencies_parsed_at":"2025-01-27T14:38:07.305Z","dependency_job_id":"05ef9dd5-8731-49eb-bee8-f5a8c34e4cc6","html_url":"https://github.com/GrottoPress/wordpress-dev","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fwordpress-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fwordpress-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fwordpress-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Fwordpress-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrottoPress","download_url":"https://codeload.github.com/GrottoPress/wordpress-dev/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244973695,"owners_count":20541022,"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":["docker","docker-compose","wordpress","wordpress-docker"],"created_at":"2024-11-29T02:17:28.238Z","updated_at":"2025-12-30T20:43:16.504Z","avatar_url":"https://github.com/GrottoPress.png","language":null,"readme":"# WordPress Development\n\nA WordPress development environment, using [docker](https://www.docker.com) (via [docker-compose](https://docs.docker.com/compose/)), complete with [WordPress](https://wordpress.org), [PHP FPM](https://php-fpm.org), [MariaDB](https://mariadb.org), [Nginx](https://nginx.org), [composer](https://getcomposer.org), [WP-CLI](https://wp-cli.org), [npm](https://www.npmjs.com) and [git](https://git-scm.com) services.\n\n## Installation\n\n- Create a new directory for your project: `mkdir my-wordpress-project`\n- Change into this directory: `cd my-wordpress-project`\n- Clone this repository: `git clone https://github.com/GrottoPress/wordpress-dev.git ../wp-dev`\n- Copy `src/` files into your new project's directory: `cp -rf ../wp-dev/src/. .`\n- Copy the `sample.env` file to `.env`: `cp sample.env .env`\n- Set permissions for the `.env` file: `chmod 0600 .env`\n- Edit the variables in your new `.env` file to taste\n- Run `docker-compose up -d` to start the services\n- Visit `http://\u003cNGX_HOST\u003e:\u003cNGX_PORT\u003e` (use the host and port you set in `.env`) in your browser to complete WordPress' installation\n\n## Environment Variables\n\nThe following variables are available for use in your `.env` file:\n\n| Variable            | Description                          |\n|---------------------|--------------------------------------|\n| `DB_ROOT_PASS`      | Database root user password          |\n| `DB_NAME`           | Database name                        |\n| `DB_USER`           | Database user                        |\n| `DB_PASS`           | Database user password               |\n| `NGX_HOST`          | Hostname of virtual host             |\n| `NGX_PORT`          | The port on the host machine to bind the nginx container's port to. Determines the port to access the WordPress installation on the host machine |\n| `PHP_VERSION`       | Format: `\u003cmajor\u003e.\u003cminor\u003e`. |\n| `WP_VERSION`        | Format: `\u003cmajor\u003e.\u003cminor\u003e`. |\n| `WP_DEBUG`          |  |\n| `WP_TABLE_PREFIX`   |  |\n| `WP_AUTH_KEY`       |  |\n| `WP_LOGGED_IN_KEY`  |  |\n| `WP_AUTH_SALT`      |  |\n| `WP_LOGGED_IN_SALT` |  |\n| `WORK_DIR`          | Directory of the particular plugin or theme you are working on. Sets the context for composer, npm and git commands. Eg: `wp-content/plugins/my-plugin` |\n\n## Get to Work\n\nThe `wp-content` directory of the WordPress installation corresponds to the the `app/` directory of your project.\n\nTherefore, if developing a theme, it goes into the `app/themes/` directory. Plugins go into the `app/plugins/` directory.\n\nYou should have set the `WORK_DIR` environment variable to the directory of the theme or plugin you are working on.\n\nThis way, you do not need to `cd` into that directory to issue `git`, `npm` or `composer` commands.\n\n## Using Commands\n\nCopy and paste the following into your `~/.bashrc` file.\n\n```bash\n# BEGIN: Docker/compose\n#\n\ndocker_compose_git()\n{\n    if [ -f \"${PWD}/docker-compose.yml\" ]; then\n        docker-compose run --rm git \"$@\"\n    else\n        $(which git) \"$@\"\n    fi\n}\n\ndocker_compose_composer()\n{\n    if [ -f \"${PWD}/docker-compose.yml\" ]; then\n        docker-compose run --rm composer \"$@\"\n    else\n        $(which composer) \"$@\"\n    fi\n}\n\ndocker_compose_wp()\n{\n    if [ -f \"${PWD}/docker-compose.yml\" ]; then\n        docker-compose run --rm wp-cli wp \"$@\"\n    else\n        $(which wp) \"$@\"\n    fi\n}\n\ndocker_compose_npm()\n{\n    if [ -f \"${PWD}/docker-compose.yml\" ]; then\n        docker-compose run --rm node npm \"$@\"\n    else\n        $(which npm) \"$@\"\n    fi\n}\n\nalias wp=\"docker_compose_wp\"\nalias composer=\"docker_compose_composer\"\nalias npm=\"docker_compose_npm\"\nalias git=\"docker_compose_git\"\n\n#\n# END: Docker/Compose\n```\nRun `source ~/.bashrc` or restart terminal, to load the new configuration.\n\nYou may then use `wp`, `composer`, `npm` and `git` commands as you would normally.\n\n## Useful commands\n\n- Start containers: `docker-compose up -d`\n- Stop containers: `docker-compose down`\n- Check container logs: `docker-compose logs \u003cservice\u003e`. Eg: `docker-compose logs nginx`\n- Access container shell prompt: `docker-compose exec \u003cservice\u003e /bin/sh`. Eg: `docker-compose exec nginx /bin/sh`\n\n## Notes on Changing WordPress version\n\nCurrently, the entire WordPress installation is persisted in a named volume (`app`), to ensure the other services (eg: `nginx`) have access to them. (This is not ideal; any ideas are welcome.)\n\nTherefore, if you change the WordPress version, you need to remove the corresponding volume (`wordpress_app`) with the command `docker volume rm wordpress_app`, before running `docker-compose up -d` again.\n\nRemember to stop containers, with `docker-compose down`, before removing volume.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Fwordpress-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrottopress%2Fwordpress-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Fwordpress-dev/lists"}