{"id":16756607,"url":"https://github.com/gnowland/wordpress-docker-deploy","last_synced_at":"2025-06-27T05:33:36.859Z","repository":{"id":71087057,"uuid":"307577648","full_name":"gnowland/wordpress-docker-deploy","owner":"gnowland","description":"A makefile-managed all-in-one development system for scaffolding, pushing, pulling, and syncing databases and files between local \u0026 remote Dokku-managed Docker instances. Includes WordPress out of the box.","archived":false,"fork":false,"pushed_at":"2020-10-31T07:34:00.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-16T07:22:24.998Z","etag":null,"topics":["devops","docker","dokku","makefile","rsync","shell-scripts","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/gnowland.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-10-27T03:44:03.000Z","updated_at":"2023-03-26T23:09:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"a079a68a-ec50-4ad2-9fbd-fbeae7c713ef","html_url":"https://github.com/gnowland/wordpress-docker-deploy","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/gnowland/wordpress-docker-deploy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnowland%2Fwordpress-docker-deploy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnowland%2Fwordpress-docker-deploy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnowland%2Fwordpress-docker-deploy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnowland%2Fwordpress-docker-deploy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnowland","download_url":"https://codeload.github.com/gnowland/wordpress-docker-deploy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnowland%2Fwordpress-docker-deploy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262198585,"owners_count":23273874,"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":["devops","docker","dokku","makefile","rsync","shell-scripts","wordpress"],"created_at":"2024-10-13T03:26:26.165Z","updated_at":"2025-06-27T05:33:36.832Z","avatar_url":"https://github.com/gnowland.png","language":"Makefile","readme":"# WordPress Docker Build \u0026 Deploy Wizard 🧙\nA makefile-managed all-in-one development system for scaffolding, pushing, pulling, and syncing databases and files to and from local and staging and remote servers. Phew.\n\nCurrently in use on a [Dokku](http://dokku.viewdocs.io/dokku/)-powered [Docker](https://docker.com)-ized [WordPress](https://wordpress.org) installation.\n\nMinor modifications would be required to generalize it for use in any environment.\n\n## Requirements\n\n- A fresh installation of [Ubuntu 18.04 x64](https://www.ubuntu.com/download)\n- The FQDN set\n  - Run `sudo hostname -f` to check if the system has an FQDN set\n- At least 1GB of system memory\n- A domain name pointed at the host's IP (optional)\n\n## Use\n\n### Make Commands (local)\n\nCommands sourced from `Makefile`.\n\n`make build` clones repo from https://github.com/WordPress/WordPress using variables within `.env` and configuration files within `config` and deploys it to a ([Docker](https://docker.com) container running [heroku-buildpack-php](https://github.com/heroku/heroku-buildpack-php) using the a [gliderlabs/herokuish](https://github.com/gliderlabs/herokuish) build orchestration on `git push dokku master`.\n\n| Command                     | Action                                                       |\n| --------------------------- | ------------------------------------------------------------ |\n| `make help`                 | Outputs all commands \u0026 instructions.                         |\n| `make build`                | Scaffold or Update WP Container. After running this `cd [\u003cappname\u003e] \u0026\u0026 git push dokku master`      |\n| `make instructions`         | Show initial application set-up instructions (db setup, filesystem setup, etc)                     |\n| `make diff_prod`            | Compare local changes with what's on the dev/prod server (depending on what's set in `/etc/hosts`) |\n| `make push [\u003clocal path\u003e] [\u003cremote hostname or USER@HOST\u003e]:[\u003cremote path\u003e]`*  | Send files to specified `ENV` server (optionally takes a path relative to `src/`, prompts otherwise) |\n| `make pull [\u003cremote hostname or USER@HOST\u003e]:[\u003cremote path\u003e] [\u003clocal path\u003e]`*  | Get files from specified `ENV` server (optionally takes a path relative to `src/`, prompts otherwise) |\n| `make sync [\u003cfrom hostname or USER@HOST\u003e] [\u003cto hostname or USER@HOST\u003e]` | Pull database, `wp-content` from _origin_ and push to _destination_ (prompts for each procedure) |\n| `make plugit [\u003cuser/repo\u003e] ENV=[\u003chost or USER@]HOST\u003e]` | Download a git repo to the specified `ENV` server's `wp-content/plugins` folder, set proper ownership \u0026 permissions |\n| `make destroy`              | 🧨 Permanently destroys the database, app, \u0026 all stored files (fresh start) 🧨                          |\n| Development                 |                                                                                                         |\n| `make dev`                  | \"`vagrant up`\" Power up (or create, if it doesn't already exist) the VM                                 |\n| `make dev_down`             | \"`vagrant halt`\" Shut down the VM                                                                       |\n| `make dev_reload`           | \"`vagrant reload`\" Restart the VM (loads any Vagrantfile changes)\u003cbr\u003ePass `--provision` to re-provision |\n| `make dev_ssh`              | \"`vagrant ssh`\" SSH into the VM                                                                         |\n| `make dev_ssh_info`         | \"`vagrant ssh-config dokku`\" Output the SSH info (for use in `~/.ssh/config`)                           |\n| `make dev_destroy`          | \"`vagrant destroy`\" 🧨 Permanently destroys all remnants of the VM: the database, app, \u0026 all stored files (fresh start) 🧨 |\n| `make theme_build [\u003clocal path\u003e] [\u003chostname or USER@HOST\u003e]:[remote path]` | Run the theme build (CSS/JS compile) scripts \u0026 push to `[\u003chostname or USER@HOST\u003e]:[remote path]` |\n\n\u003e \\*Before `make push ...`, `make pull ...`, `make theme_build ...`, or `vscode-ext.sync-rsync` will work you must first modify the host `visudo` settings to allow unattended operations:\n\n```shell\n# remote\nwhich rsync # take note of the result!\nsudo visudo\n\n# ...and add the following to the bottom of the file (lower instructions take precedence):\n[\u003cusername\u003e] ALL=NOPASSWD:[\u003cpath returned from which rsync\u003e]\n```\n\n\u003e ⚠️ IMPORTANT PUSH/PULL/SYNC TARGET PATH INFORMATION:\n\u003e - Source\n\u003e   - When using \"/\" at the end of source path, rsync will copy the *content* of the source folder to the destination, but not the folder itself.\n\u003e   - When omitting \"/\" from the end of source path, rsync will copy *the folder and its content* to the destination.\n\u003e - Destination\n\u003e   - When using \"/\" at the end of the destination path, rsync will place the data *inside the last destination folder*.\n\u003e   - When omitting \"/\" from the end of the destination path, rsync will *create a folder with the name of the last destination* and paste the data inside that folder.\n\n### Shell Scripts (server)\n\nCommands sourced from `.profile`.\n\nCopy `.profile` up to the server:\n\n```shell\n# local ./\nscp .profile [\u003cremote hostname or USER@HOST\u003e]:~\n\n# remote ~/\nsource .profile\n```\n\n| Command                                                    | Action                                                       | Notes                                                        |\n| ---------------------------------------------------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |\n| `la [\u003c(opt: dir)\u003e]`                                        | Supercharged `ls` (list files)                               | Uses current `dir` if unspecified                            |\n| `lap [\u003c(opt: dir)\u003e]`                                       | `la` with \"octal permissions\" (e.g. 755)                     | ☝️                                                            |\n| `bin [\u003cappname\u003e] [\u003c(opt: sudo)\u003e]`                          | Enter container as root                                      | Executes `docker exec -it [\u003cappname\u003e].web.1 /bin/bash;`\u003cbr\u003e (assumes `docker ps` 'name')`\u003cbr\u003e Shorthand: `sudo : -s` |\n| Copy files into (`-i`) or out of (`-o`) a docker container | `dcp -[\u003ci/o\u003e] [\u003csource\u003e] [\u003capp name\u003e] [\u003cdestination\u003e]`       | Executes `docker cp [\u003csource\u003e] [\u003cappname\u003e]:[\u003cdestination\u003e]` (swapping order for in/out) |\n| `wgit [\u003cuser/repo\u003e]`                                       | Download a git repo (e.g. plugin), extract, set ownership \u0026 permissions | Sets ownership to 32767 (container user)                     |\n| `uzp [\u003cfile.zip\u003e]`                                         | Extract a `.zip` file, set ownership \u0026 permissions           | ☝️, (also: be sure to verify unzipped directory name!)        |\n| `pfix`                                                     | Fix ownership \u0026 permissions of current directory \u0026 subdirectories | Sets ownership to 32767 (container user)                     |\n| `av [\u003con/off\u003e]`                                            | Turn on/off Sophos AV                                        | Shorthand: `on : -i`, `off : -o`                             |\n| `clr`                                                      | Clear up RAM (PageCache, Swapfile)                           | Not recommended to run often, or in live environments!       |\n| `db [\u003cexport/import\u003e] [\u003c(import.sql)\u003e]`                    | Import or export a database dump                             | Export: Database dumps to `~/.sql` with timestamped filename.\u003cbr\u003eImport: requires passing a `dump.sql` file\u003cbr\u003eShorthand: `export: -e`, `import: -i` |\n| `sync [\u003cup/down\u003e]`                                         | Sync `wp-content` files up or down from VAGRANT (dev) server | Note: this only works between local \u0026 vagrant, this **will not work on remote (prod)**\u003cbr\u003eShorthand: `up: -u`, `down: -d` |\n\n\n## Upgrading WordPress\n\nTo upgrade to a later version of WordPress just change the version number in the `.env` file and run `make build` again!\n\n\u003e ⚠️ Warning: A 'traditional' upgrade performed using the WordPress UI-based upgrade process will not survive a server app restart (due to the ephemeral nature of the underlying docker-based filesystem) and thus should not be attempted if you want to persist the upgrade.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnowland%2Fwordpress-docker-deploy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnowland%2Fwordpress-docker-deploy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnowland%2Fwordpress-docker-deploy/lists"}