AWS ECS Service for Wordpress

0 votes

I created a service for wordpress on AWS ECS with the following container definitions

{
  "containerDefinitions": [
    {
      "name": "wordpress",
      "links": [
        "mysql"
      ],
      "image": "wordpress",
      "essential": true,
      "portMappings": [
        {
          "containerPort": 0,
          "hostPort": 80
        }
      ],
      "memory": 250,
      "cpu": 10
    },
    {
      "environment": [
        {
          "name": "MYSQL_ROOT_PASSWORD",
          "value": "password"
        }
      ],
      "name": "mysql",
      "image": "mysql",
      "cpu": 10,
      "memory": 250,
      "essential": true
    }
  ],
  "family": "wordpress"
}

Then went over to the public IP and completed the Wordpress installation. I also added a few posts.

But now, when I update the service to use a an updated task definition (Updated mysql container image)

"image": "mysql:latest"

I loose all the posts created and data and Wordpress prompts me to install again.

What am i doing wrong?

I also tried to use host volumes but to no vail - creates a bind mount and a docker managed volume (Did a docker inspect on container).

So, every time I update the task it resets Wordpress.

Sep 20, 2018 in AWS by bug_seeker
• 15,510 points
1,534 views

1 answer to this question.

0 votes

If your container needs access to the original data each time it starts, you require a file system that your containers can connect to regardless of which instance they’re running on. That’s where EFS comes in.

EFS allows you to persist data onto a durable shared file system that all of the ECS container instances in the ECS cluster can use.

Step-by-step Instructions to Setup an AWS ECS Cluster

Using Data Volumes in Tasks

Using Amazon EFS to Persist Data from Amazon ECS Containers

answered Sep 20, 2018 by Priyaj
• 58,020 points

Related Questions In AWS

0 votes
1 answer
+1 vote
2 answers
+3 votes
1 answer

aws cloudformation for atomic stack-update

When you perform a stack update, only ...READ MORE

answered Mar 27, 2018 in AWS by DareDev
• 6,890 points
1,092 views
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,714 views
+2 votes
1 answer
0 votes
1 answer

Amazon AWS - simple email service for Sydney region

SES is just an authenticated endpoint on ...READ MORE

answered Jul 20, 2018 in AWS by Priyaj
• 58,020 points
667 views
+1 vote
1 answer

How does AWS EC2 Bitnami Wordpress setting security permissions for outsourced developer

cd /opt/bitnami/apps/wordpress/ sudo ./bnconfig --userpassword YOUR_NEW_PASSWORD Change password ...READ MORE

answered Aug 23, 2018 in AWS by Priyaj
• 58,020 points
1,075 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP