简体   繁体   English

如何将 python docker 映像部署到 AWS Elastic beanstalk?

[英]How to deploy a python docker image to AWS Elastic beanstalk?

I received a python docker image that works perfectly in local.我收到了一个在本地完美运行的 python docker 镜像。 All I need to do is enter docker-compose up to run the app on localhost.我需要做的就是输入docker-compose up在本地主机上运行应用程序。

However, this is a completely different story when it comes to deploy it on AWS Elastic beanstalk and I am struggling since many hours to make it works.但是,当将它部署到 AWS Elastic beanstalk 上时,这是一个完全不同的故事,而且我已经挣扎了好几个小时才能使其正常工作。

Here is the Dockerfile这是Dockerfile

FROM python:3.6-stretch

WORKDIR /app

COPY . /app

RUN pip3 --no-cache-dir install -r requirements.txt

EXPOSE 5000

ENTRYPOINT [ "python" ]

CMD [ "app.py" ]

then I've build the image by entering docker build .然后我通过输入docker build .图像docker build . and I compress the folder.然后我压缩文件夹。

On AWS I create a "python docker" application and I upload my zip file.在 AWS 上,我创建了一个“python docker”应用程序并上传了我的 zip 文件。 AWS deploy my application successfully and the health color is green but when I click on the app URL I get a internal error message. AWS 成功部署了我的应用程序并且运行状况颜色为绿色,但是当我单击应用程序 URL 时,我收到一条internal error消息。 I don't see any error in the bundleLogs.我在 bundleLogs 中没有看到任何错误。

I can't find the solution to deploy my docker image to AWS elastic beanstalk without issues.我找不到可以毫无问题地将我的 docker 映像部署到 AWS elastic beanstalk 的解决方案。

Any help will be very appreciated.任何帮助将不胜感激。

Thanks谢谢

It is quite easy, and there is very good guiding material on AWS:这很容易,而且 AWS 上有非常好的指导材料:

See Single Container Docker environments on Elastic Beanstalk and Single Container Docker configuration请参阅Elastic Beanstalk 上的单容器 Docker 环境单容器 Docker 配置

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

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