amazon-web-services - 使用 ecs-cli 在 aws 上部署 docker compose 会出现错误
问题描述
使用 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
码头工人-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工具,通过它您可以更好地管理您的基础设施(幂等性)。
推荐阅读
- c++ - 如何用另一个模板作为参数初始化模板类?
- c++ - 无法使用 QSerialport readAll() 方法读取字节数组
- angular - Angular Material Stepper:服务器端验证操作
- angular - 在选择选项中设置默认静态值
- c# - MySQL 返回“无法添加或更新子行:外键约束失败”
- ruby - 无法访问评论对象中的用户
- php - 如何为“/{anything}”此路径重定向主页,但为“/profile/{anything}”此路径重定向到 profile.blader.php?
- python - 列表插入方法
- c# - 如何使用 MS ClearScript 扩展 C# 类型?
- python - 如何根据斑马条纹的顶点坐标计算斑马线区域的顶点坐标?