GithubHelp home page GithubHelp logo

lenworthhenry / wordpress-fargate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from horsfieldsa/wordpress-fargate

0.0 1.0 0.0 1007 KB

Example project that deploys Wordpress to ECS Fargate, Aurora MySQL and S3.

Shell 64.80% Dockerfile 35.20%

wordpress-fargate's Introduction

wordpress-fargate:

An example project that deploys Wordpress to ECS Fargate w/ an Aurora MySql database. Uses the stelligent/mu framework for pipeline management.

Getting Started

  1. Clone the repo locally.
  2. Install AWS CLI.
  3. Create an IAM Dev User with the following Policy AdministratorAccess
  4. Run AWS Configure aws configure
    • Put In your access key and secret from step 3 when prompted
  5. Install stelligent/mu.
  6. Create an IAM Application User and configure access keys. User should have at least the following permissions:
    • s3:GetObject

    • s3:GetObjectVersion

    • s3:GetObjectVersionTagging

    • s3:DeleteObject

    • s3:DeleteObjectVersion

    • s3:DeleteObjectTagging

    • s3:PutObject

    • s3:PutObjectAcl

    • s3:PutObjectTagging

    • s3:ListBucket

    • s3:ListAllMyBuckets

    • s3:ListBucketVersions

    • NOTE: The template will create a user with these permissions that you can assign an access key to, however this requires two deployments (one to create the access key, then a manual step, then another to set the environment variable)

  7. Put the access key id and secret in separate parameters in parameter store which can be found in EC2 Systems Manager
  8. Update mu.yml with the names of the parameters, just use the name of key, the docker file will call getParameter to decode the actual value, no brackets are needed
  9. Create a new Hosted zone for your domain in Route 52 and ensure your domain is set up to use amazon's nameservers.
  10. Replace shhorsfi.myinstance.com in mu.yml with the domain of your hosted zone
  11. Run mu pipeline up.
  12. Logon to Wordpress by navigating to your domain (Create Admin/Password).
  13. Enable WP Offload S3 Lite Plugin
  14. Enable the following Settings:
    • Copy Files to S3
    • Rewrite File URLs
    • CloudFront or Custom Domain
    • Remove Files From Server

Limitations

  1. The WP Offload S3 Lite Plugin doesn't support ECS Task IAM Roles. To work-around this we need to create an IAM user, and configure access keys. Currently the access key id and secret are stored in parameter store. The name of the parameters are defined as environment variables in mu.yml.
  2. You have to manually activate the WP Offload S3 Lite Plugin, and configure some of its settings.
  3. Plugins are not handled in a way that they can be applied across all tasks without re-building the docker container image. If Fargate handled peristent data-volumes this could be solved, or the provider could be changed from ECS-FARGATE to ECS, and the templates could be updated to handle an EFS volume. This would require a process for building a custom AMI or bootstrap an ECS optimized AMI. Tutorial
  4. Wordpress upgrades are not handled (this is tracked as an issue in the official Docker image).

TODO:

  • Put WP Offload S3 Lite settings in entrypoint.sh script.
  • Auto-put secrets in parameter store as part of template. (Create User, Create Access Key, Create Parameter).
  • Error handling in entrypoint script.
  • Pretty Diagrams
  • CloudFront Configuration

References

wordpress-fargate's People

Contributors

horsfieldsa avatar mattbucci avatar lenworthhenry avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.