在AWS ECS上对Drupal 8进行Docker错误操作:Drupal目标组中的任务ELB运行状况检查失败 [英] Dockerizing Drupal 8 on AWS ECS Error: Task failed ELB health checks in Target group for Drupal

查看:128
本文介绍了在AWS ECS上对Drupal 8进行Docker错误操作:Drupal目标组中的任务ELB运行状况检查失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对Drupal 8进行Docker化.在DockerFile以下.

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

问题

  1. 我在上面的文件中缺少任何内容吗?
  2. 停止原因:Task failed ELB health checks in (target-group arn:aws:elasticloadbalancing:ap-southeast-1:1111111:targetgroup/ecs-drupal/eff768afe54dda4a)

我不确定ECS群集配置或任务定义中缺少什么?

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

推荐答案

我很长时间以来一直遇到此问题,发现由于Drupal将根URL设置为重定向到/core/install.php,因此这些AWS运行状况检查失败是因为302重定向状态代码标记为失败".

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."

如果将运行状况检查更改为将200和302都接受为运行状况"状态代码,则它将清除运行状况检查,并且将起作用.

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.

这篇关于在AWS ECS上对Drupal 8进行Docker错误操作:Drupal目标组中的任务ELB运行状况检查失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆