{"id":15648670,"url":"https://github.com/mdelapenya/wordpress-docker-workflow","last_synced_at":"2025-04-30T14:41:31.855Z","repository":{"id":141610098,"uuid":"111391030","full_name":"mdelapenya/wordpress-docker-workflow","owner":"mdelapenya","description":"A basic, simple workflow for managing Wordpress with Docker","archived":false,"fork":false,"pushed_at":"2017-11-20T09:48:00.000Z","size":4,"stargazers_count":11,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T17:04:50.283Z","etag":null,"topics":["docker","git-ftp","shell-scripts","wordpress","workflow"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdelapenya.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-11-20T09:46:11.000Z","updated_at":"2024-06-05T13:19:50.000Z","dependencies_parsed_at":"2023-04-11T06:09:11.714Z","dependency_job_id":null,"html_url":"https://github.com/mdelapenya/wordpress-docker-workflow","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/mdelapenya%2Fwordpress-docker-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fwordpress-docker-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fwordpress-docker-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdelapenya%2Fwordpress-docker-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdelapenya","download_url":"https://codeload.github.com/mdelapenya/wordpress-docker-workflow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251722824,"owners_count":21633023,"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","git-ftp","shell-scripts","wordpress","workflow"],"created_at":"2024-10-03T12:25:48.670Z","updated_at":"2025-04-30T14:41:31.826Z","avatar_url":"https://github.com/mdelapenya.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker Workflow with Wordpress\n\n## Workflow\n\nBasically, this workflow performs the basic operations to manage your Wordpress application using Git as SCM. You just have to copy these files in the root folder of your Wordpress project, and the workflow will be available.\n\nThe actions you can do with this workflow are:\n\n- Execute `run-docker.sh` to start a container on `port 80`.\n- Execute `publish.sh [all|staging|production]` to publish to your live environments.\n\nHow do we publish to the live environments? Using [git-ftp](https://github.com/git-ftp/git-ftp), which is super cool for dealing with traditional, old-school operations on hosting servers using FTP. With this tool we can use Git to send only the required files by FTP, not all-or-nothing.\n\nThe workflow has to configure two remote sites with `git-ftp`, with names `staging` and `production`. Please read about how to configure them at project's repository.\n\nTo set up your workflow, **it's mandatory** to write down your custom values in a `.workflow.properties` file at the root directory of your Wordpress project.\n\n    There is a sample file for this configuration, named `.workflow-sample.properties`.\n\n## Git Branches\n\nIt's **mandatory** to have these three local branches to use this workflow:\n\n- `dev`: where you create new features.\n- `staging`: this branch will be pushed to your Staging environment.\n- `master`: this branch will be pushed to your Production environment.\n\nThe workflow will move commits from `dev` to `staging` and to `master`, respectively when publishing to the proper environment.\n\n    A git tag will be created when publishing to production, using as tag name the value defined in the file blog-version.txt. So keep that file up-to-date!\n\n## Environments\n\nIt's **mandatory** to have three environments:\n\n - `Local`: a dockerised environment for testing locally. It will package the Wordpress application into a Docker container, following the LAMP stack. You can find the Docker image representing this environment [here](https://hub.docker.com/r/mdelapenya/lamp). You can find the code [here](https://github.com/mdelapenya/lamp).\n - `Staging`: a live environment for testing the Wordpress application before publishing to production. You can push your code here and review your changes. This workflow uses `dev` as subdomain.\n - `Production`: the live environment for the Wordpress application.\n\nI.e.:\n\n- local: http://localhost\n- staging: http://dev.my-wordpress.com\n- production: http://www.my-wordpress.com\n\n## Files\n\n### Versioning your project\n\nSet the version of your Wordpress application in the `blog-version.txt` file. It will be used to create `git tags` for your project.\n\n### Configuring Database (mysql-setup)\n\n    This script is executed on build time of the Docker image.\n\nThis script initialises the database in the MySQL server that is bundled into the LAMP image.\n\nYou have to configure it with your database name, your database user, and its password.\n\n### Updating Wordpress URLs (change-wp-url)\n\n    This script is executed on build time of the Docker image.\n\nAs Wordpress hardcodes its URL in the database (WTF!), this script replaces all those ocurrences and applies the DNS name of the Wordpress environment.\n\nIt accepts one parameter, representing the environment where to apply the DNS name.\n\n- `local`: it will apply `localhost` as URL for the environment, so it can be executed inside the Docker container.\n- `staging`: it will prepend the `dev.` subdomain to the DNS, so it's important to understand that it's mandatory to have th\n- `Any other value`: it will use the real DNS name, so all URL will be replaced with the real ones.\n\nYou have to configure it with your database name, and the DNS name of your Wordpress, without `www`, i.e. `mdelapenya.org`.\n\nNOTE: please make sure that the real paths for the environments match with your hosting provider, including subdomains. In my case, I use [Interdominios](www.interdominios.com), which uses `/var/www/vhosts/mdelapenya.org\\` for environments, and `` for subdomains.\n\n### Running Docker container (run-docker)\n\n    This script is executed every time we want to recreate the container.\n\nIt builds the image based on the current Dockerfile, copying your Wordpress installation to the Docker image. Then it `removes` the already existing container (`Cattle, not Pets`), and runs a new instance of the image, applying one volume for the `wp-content` folder.\n\n    You have to configure it with your DockerHub user, the name of the Docker image, the name of the Docker container you want to use, and the name of the Wordpress theme you are using, just in case you need it. Please see the .workflow-sample.properties file.\n\n## Publishing (publish)\n\nThis script publish your Wordpress to the environment you specify.\n\nIt accepts only one parameter, with following values:\n\n- `all`: push your Wordpress to both staging and production\n- `stating`: push your Wordpress to staging\n- `production`: push your Wordpress to production","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdelapenya%2Fwordpress-docker-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdelapenya%2Fwordpress-docker-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdelapenya%2Fwordpress-docker-workflow/lists"}