Dockerizing Drupal 8 on AWS ECS Error: Task failed ELB health checks in Target group for Drupal

不羁岁月 提交于 2020-06-17 09:15:47

问题


I am trying to Dockerize my Drupal 8. Below DockerFile I have.

FROM drupal:8.8

RUN apt-get update && apt-get install -y \
    curl \
    git \
    mysql-client \
    vim \
    wget

RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && \
    php composer-setup.php && \
    mv composer.phar /usr/local/bin/composer && \
    php -r "unlink('composer-setup.php');"

RUN wget -O drush.phar https://github.com/drush-ops/drush-launcher/releases/download/0.4.2/drush.phar && \
    chmod +x drush.phar && \
    mv drush.phar /usr/local/bin/drush

RUN rm -rf /var/www/html/*

WORKDIR /drupal

Questions

  1. Am I missing anything in above file?
  2. Stopped reason : Task failed ELB health checks in (target-group arn:aws:elasticloadbalancing:ap-southeast-1:1111111:targetgroup/ecs-drupal/eff768afe54dda4a)

I am not sure what I am missing in ECS Cluster configuration or Task definition?


回答1:


It means you failed the health check so that maybe your container is working properly on your local environment, but you should check your Target Group -> health check.

You can set a health check path, interval, timeout, success code...etc on the Target Group health check setting. Then I think it should be the issue you are looking for.

So you can following the steps below:
1) Build and run your container locally, can check the health page on your local machine.
2) Check the Target Group -> Health Check settings




回答2:


I had this problem for a long time and found that because Drupal sets the root URL to redirect to /core/install.php, these AWS health checks fail because 302 Redirect status codes are marked as "failures."

If you change the Health Check to accept both 200 and 302 as "healthy" status codes, then it will clear the health check and it will work.



来源:https://stackoverflow.com/questions/60304117/dockerizing-drupal-8-on-aws-ecs-error-task-failed-elb-health-checks-in-target-g

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!