|
| 1 | +# oanhnn/example-wordpress-with-docker |
| 2 | + |
| 3 | +An example for developing Wordpress sites with Docker and deploy to AWS Elastic Beanstalk |
| 4 | + |
| 5 | +## Requiments |
| 6 | + |
| 7 | +- Bash |
| 8 | +- Git |
| 9 | +- Docker |
| 10 | +- Docker Compose |
| 11 | + |
| 12 | +## Project organisation |
| 13 | + |
| 14 | +This is what each item is for: |
| 15 | + |
| 16 | +* `app/` – The WordPress application files are in this directory. |
| 17 | +* `bin/` – Useful command-line scripts. |
| 18 | +* `data/` – MySQL dump files go here. |
| 19 | +* `docker/` – Files required by the Docker setup are in this directory. |
| 20 | +* `README.md` – Every project needs a README! |
| 21 | +* `docker-compose.yml` – Development orchestration config file. |
| 22 | +* `Dockerrun.aws.json` - Elastic Beanstalk config file. |
| 23 | + |
| 24 | +## Dev |
| 25 | + |
| 26 | +#### Setup project |
| 27 | + |
| 28 | +``` |
| 29 | +$ git clone git@github.com:oanhnn/example-wordpress-with-docker.git project_dir |
| 30 | +$ cd project_dir |
| 31 | +$ cp .env.example .env |
| 32 | +$ mkdir app |
| 33 | +$ docker-compose up -d |
| 34 | +``` |
| 35 | + |
| 36 | +#### Backup database |
| 37 | + |
| 38 | +``` |
| 39 | +$ bin/backup-db.sh data/dump-20190807-102134.sql |
| 40 | +``` |
| 41 | + |
| 42 | +#### Restore database |
| 43 | + |
| 44 | +``` |
| 45 | +$ bin/restore-db.sh data/dump-20190807-102134.sql |
| 46 | +``` |
| 47 | + |
| 48 | +#### Change site URL |
| 49 | + |
| 50 | +``` |
| 51 | +$ bin/change-url.sh http://dev.example.com https://example.com |
| 52 | +``` |
| 53 | + |
| 54 | +## Deploy to AWS Elastic Beanstalk |
| 55 | + |
| 56 | +Follow the steps below to deploy this application to an Elastic Beanstalk Multi-container Docker environment. Accept the default settings unless indicated otherwise in the steps below: |
| 57 | + |
| 58 | +1. Download the ZIP file from the Releases section of this repository. |
| 59 | +2. Login to the [Elastic Beanstalk Management Console](https://console.aws.amazon.com/elasticbeanstalk) |
| 60 | +3. Click ***Create New Application*** and give your app a name and description |
| 61 | +4. Click ***Create web server*** and select an IAM instance profile to use. |
| 62 | + > Note: Please ensure the IAM instance profile you select has the necessary permissions. For more information, see [Container Instance Role](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_docker_ecs.html#create_deploy_docker_ecs_role) |
| 63 | +5. Choose ***Multi-container Docker*** in the ***Predefined configuration*** dropdown and click ***Next*** |
| 64 | +6. Upload the ZIP file downloaded in step 1 |
| 65 | +7. Review and launch the application |
| 66 | + |
| 67 | +## Contributing |
| 68 | + |
| 69 | +All code contributions must go through a pull request and approved by a core developer before being merged. |
| 70 | +This is to ensure proper review of all the code. |
| 71 | + |
| 72 | +Fork the project, create a feature branch, and send a pull request. |
| 73 | + |
| 74 | +If you would like to help take a look at the [list of issues](https://github.com/oanhnn/example-nginx-proxy-auto-ssl/issues). |
| 75 | + |
| 76 | +## License |
| 77 | + |
| 78 | +This project is released under the MIT License. |
| 79 | +Copyright © 2019 [Oanh Nguyen](https://github.com/oanhnn) |
| 80 | +Please see [License File](https://github.com/oanhnn/example-nginx-proxy-auto-ssl/blob/master/LICENSE) for more information. |
0 commit comments