Skip to content

Lightsail container service: deployment took too long

0

Hello, I'm trying to run 2 containers: bitnami/mariadb:10.6 and bitnami/wordpress:6, both of them are a bit customized but run properly locally. I encountered the issue that the containers simply won't start up. I get the following log in the middle of wordpress/mariadb startup and both services get killed, afterwards I'm rolled back to previous deployment:

[deployment:3] Took too long.

The images are built locally and stored at AWS Lightsail image repository (and pulled from there during deployments). My deployment JSON file is as follows:

{
  "serviceName": "project-container-service-1",
  "containers": {
    "mariadb": {
      "image": ":project-container-service-1.project-wordpress.23",
      "environment": {
        "MARIADB_USER": "value",
        "MARIADB_PASSWORD": "value",
        "MARIADB_ROOT_PASSWORD": "value",
        "MARIADB_DATABASE": "value",
        "MARIADB_PORT": "9050"
      },
      "ports": {
        "9050": "TCP"
      }
    },
    "wordpress": {
      "image": ":project-container-service-1.project-wordpress.22",
      "environment": {
        "WORDPRESS_DATABASE_HOST": "localhost",
        "WORDPRESS_DATABASE_USER": "value",
        "WORDPRESS_DATABASE_PASSWORD": "value",
        "WORDPRESS_DATABASE_NAME": "value",
        "WORDPRESS_DATABASE_PORT": "9050"
      },
      "ports": {
        "8080": "HTTP",
        "8443": "HTTPS"
      }
    }
  },
  "publicEndpoint": {
    "containerName": "wordpress",
    "containerPort": 8080,
    "healthCheck": {
      "healthyThreshold": 2,
      "unhealthyThreshold": 5,
      "timeoutSeconds": 60,
      "intervalSeconds": 150,
      "successCodes": "200-299"
    }
  }
}

Dockerfile for wordpress:

FROM --platform=linux/amd64 docker.io/bitnami/wordpress:6
EXPOSE 8080
EXPOSE 8443
VOLUME /dev/xvda/project-components/wp:/bitnami/wordpress
VOLUME ../../themes/child-theme:/bitnami/wordpress/wp-content/themes/child-theme

Dockerfile for MariaDB:

FROM --platform=linux/amd64 docker.io/bitnami/mariadb:10.6
EXPOSE 3306
VOLUME /dev/xvda/project-components/db-data:/bitnami/mariadb

I already tried to play with health check and it gave no result. I did this setup referring to this video and this tutorial Any information would be useful, thank you in advance.

asked 3 years ago882 views
1 Answer
1

This may occur when Lightsail specs are low.
Therefore, using a higher level of specifications than the current one may solve the problem.
https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-container-services

EXPERT
answered 3 years ago
  • Can we keep healthcheck on one port and business apis on second?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.