简体   繁体   English

使用 ecs-cli 在 aws 上部署 docker compose 出现错误

[英]Deploying docker compose on aws using ecs-cli gives me errors

I get Internal error when I deploy my docker compose file to aws using ecs-cli .使用 ecs-cli 将 docker compose 文件部署到 aws 时出现内部错误。 In my console I get that the service is up and running as well as in the aws gui but when I try to open the link I get internal error.在我的控制台中,我知道该服务已启动并正在运行,并且在 aws gui 中也是如此,但是当我尝试打开链接时,出现内部错误。 amazon view link not working亚马逊查看链接无效

Dockerfile.txt Dockerfile.txt

FROM clojure:openjdk-8-lein

RUN apt update && apt install -y git make python3 && apt clean
WORKDIR /opt
RUN mkdir my-project && cd my-project && git clone https://github.com/ThoughtWorksInc/infra-problem.git && cd infra-problem && make libs && make clean all

docker-compose.yml docker-compose.yml

version: "3"
services:
  quotes:
    image: selmensh/newsfeeds
    build:
        context: .
        dockerfile: ./Dockerfile.txt
    container_name: quotes
    command: java -jar ./my-project/infra-problem//build/quotes.jar
    environment:
      - APP_PORT=9200
    ports:
      - 9200:9200
  newsfeed:
    image: selmensh/newsfeeds
    build: 
        context: .
        dockerfile: ./Dockerfile.txt
    container_name: newsfeed
    command: java -jar ./my-project/infra-problem/build/newsfeed.jar
    environment:
      - APP_PORT=5000
    ports:
      - 5000:5000
  assets:
    image: selmensh/newsfeeds
    build: 
        context: .
        dockerfile: ./Dockerfile.txt
    container_name: assets
    command: python3 ./my-project/infra-problem/front-end/public/serve.py
    ports:
      - 8000:8080
  front-end:
    image: selmensh/newsfeeds
    build: 
        context: .
        dockerfile: ./Dockerfile.txt
    command: java -jar ./my-project/infra-problem/build/front-end.jar
    environment:
      - APP_PORT=8081
      - STATIC_URL=http://assets:8000
      - QUOTE_SERVICE_URL=http://quotes:9200
      - NEWSFEED_SERVICE_URL=http://newsfeed:5000
      - NEWSFEED_SERVICE_TOKEN=T1&eWbYXNWG1w1^YGKDPxAWJ@^et^&kX
    depends_on:
      - quotes
      - newsfeed
    ports:
      - 80:8081

I also notice that ecs does not support build so I made an image and pushed to docker hub.我还注意到 ecs 不支持构建,所以我制作了一个图像并推送到 docker hub。 However I see that this might have some security issues since I clone the code in the docker file.但是我发现这可能有一些安全问题,因为我克隆了 docker 文件中的代码。 The reason I do this is because the code has a folder called utilities which is common and is required by all the other services.我这样做的原因是因为代码有一个名为实用程序的文件夹,它很常见,并且是所有其他服务所必需的。 Is there a better approach ?有没有更好的方法?

如果您能演示更多细节,那就太好了,这似乎是您的应用程序中的一个问题,现在我可以指出您的是terraform工具,通过它您可以更好地管理您的基础设施(幂等性)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM