[英]django+docker to elastic beanstalk
I created a super simple django app in docker, following these instructions: https://docs.docker.com/compose/django/ 我按照以下说明在docker中创建了一个超级简单的django应用程序: https : //docs.docker.com/compose/django/
Everything works locally. 一切都在本地工作。 When I try to upload the folder that includes
Dockerfile
and docker-compose.yml
to AWS Elastic Beanstalk as a multicontainer docker, it does not work. 当我尝试将包含
Dockerfile
和Dockerfile
docker-compose.yml
的文件夹作为多docker-compose.yml
AWS Elastic Beanstalk时,它不起作用。 Should I also provide Dockerrun.aws.json
? 我还应该提供
Dockerrun.aws.json
吗?
here is what I have in Dockerfile
: 这是我在
Dockerfile
拥有的Dockerfile
:
FROM python:3
ENV PYTHONUNBUFFERED 1
RUN mkdir /code
WORKDIR /code
ADD requirements.txt /code/
RUN pip install -r requirements.txt
ADD . /code/
and in docker-compose.yml
: 并在
docker-compose.yml
:
version: '3'
services:
db:
image: postgres
web:
build: .
command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
depends_on:
- db
Yes, you have to provide a Dockerrun
file. 是的,您必须提供一个
Dockerrun
文件。 From the official docs : 从官方文档 :
Multicontainer Docker instances on Elastic Beanstalk require a configuration file named
Dockerrun.aws.json
.Elastic Beanstalk上的多
Dockerrun.aws.json
Docker实例需要一个名为Dockerrun.aws.json
的配置文件。 This file is specific to Elastic Beanstalk and can be used alone or combined with source code and content in a source bundle to create an environment on a Docker platform.该文件特定于Elastic Beanstalk,可以单独使用,也可以与源代码包中的源代码和内容结合使用,以在Docker平台上创建环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.