问题
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
- Am I missing anything in above file?
- 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