簡體   English   中英

使用 ecs-cli 在 aws 上部署 docker compose 出現錯誤

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

使用 ecs-cli 將 docker compose 文件部署到 aws 時出現內部錯誤。 在我的控制台中,我知道該服務已啟動並正在運行,並且在 aws gui 中也是如此,但是當我嘗試打開鏈接時,出現內部錯誤。 亞馬遜查看鏈接無效

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

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

我還注意到 ecs 不支持構建,所以我制作了一個圖像並推送到 docker hub。 但是我發現這可能有一些安全問題,因為我克隆了 docker 文件中的代碼。 我這樣做的原因是因為代碼有一個名為實用程序的文件夾,它很常見,並且是所有其他服務所必需的。 有沒有更好的方法?

如果您能演示更多細節,那就太好了,這似乎是您的應用程序中的一個問題,現在我可以指出您的是terraform工具,通過它您可以更好地管理您的基礎設施(冪等性)。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM