How to translate docker-compose.yml to Dockerrun.aws.json for Django -
i following instructions @ https://docs.docker.com/compose/django/ basic dockerized django app going. able run locally without problem having trouble deploy aws using elastic beanstalk. after reading here, figured need translate docker-compose.yml dockerrun.aws.json work.
the original docker-compose.yml is
version: '2' services: db: image: postgres web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db
and here translated far
{ "awsebdockerrunversion": 2, "volumes": [ { "name": "db" }, { "name": "web" } ], "containerdefinitions": [ { "name": "db", "image": "postgres", "essential": true, "memory": 256, "mountpoints": [ { "sourcevolume": "db" "containerpath": "/var/app/current/db" } ] }, { "name": "web", "image": "web", "essential": true, "memory": 256, "mountpoints": [ { "sourcevolume": "web" "containerpath": "/var/app/current/web" } ], "portmappings": [ { "hostport": 8000, "containerport": 8000 } ], "links": [ "db" ], "command": "python manage.py runserver 0.0.0.0:8000" } ] }
but it's not working. doing wrong?
i struggling ins , outs of dockerrun
format. check out container transform: "transforms docker-compose, ecs, , marathon configurations"... it's life-saver. here outputs example:
{ "containerdefinitions": [ { "essential": true, "image": "postgres", "name": "db" }, { "command": [ "python", "manage.py", "runserver", "0.0.0.0:8000" ], "essential": true, "mountpoints": [ { "containerpath": "/code", "sourcevolume": "_" } ], "name": "web", "portmappings": [ { "containerport": 8000, "hostport": 8000 } ] } ], "family": "", "volumes": [ { "host": { "sourcepath": "." }, "name": "_" } ] } container web missing required parameter "image". container web missing required parameter "memory". container db missing required parameter "memory".
that is, in new format, must tell how memory allot each container. also, need provide image - there no option build. mentioned in comments, want build , push dockerhub or ecr, give location: eg [org name]/[repo]:latest
on dockerhub, or url ecr. container-transform
mountpoints
, volumes
- it's amazing.
Comments
Post a Comment