Zappa icon indicating copy to clipboard operation
Zappa copied to clipboard

django using zappa and docker

Open abtinmo opened this issue 3 years ago • 1 comments

Context

there is already a post to run flask on docker in your readme, i tried to migrate a working django/zappa project to use docker.

is there any guide or sample project that works with django and docker?

Expected Behavior

i expect that django listens on 8000

Actual Behavior

$ curl -XPOST "http://localhost:8000/"                                                                                                                         
curl: (56) Recv failure: Connection reset by peer

Steps to Reproduce

  1. followed this blog post to create a docker image with django to use it in aws lambda
  2. docker build -t lambda-docker-django:latest .
  3. docker run -p 8000:8000 lambda-docker-django:latest 13 Jun 2022 16:21:47,803 [INFO] (rapid) exec '/var/runtime/bootstrap' (cwd=/var/task, handler=)

Your Environment

  • Zappa version used: 0.54.1

  • Operating System and Python version: debian sid, python 3.9 (on docker python 3.8)

  • The output of pip freeze: antiorm==1.2.1 argcomplete==2.0.0 asgiref==3.5.2 awscli==1.25.5 backports.weakref==1.0.post1 boto3 botocore CacheControl==0.12.11 cachy==0.3.0 certifi==2022.5.18.1 cffi==1.15.0 cfn-flip==1.3.0 charset-normalizer==2.0.12 cleo==0.8.1 click==8.1.3 clikit==0.6.2 crashtest==0.3.1 cryptography==37.0.2 db==0.1.1 db-sqlite3==0.0.1 distlib==0.3.4 Django==4.0.5 docutils==0.16 durationpy==0.5 filelock==3.7.1 future==0.18.2 hjson==3.0.2 html5lib==1.1 idna==3.3 importlib-metadata==4.11.4 jeepney==0.8.0 jmespath==1.0.0 kappa==0.6.0 keyring==23.6.0 lockfile==0.12.2 msgpack==1.0.4 packaging==20.9 pastel==0.2.1 pep517 pexpect==4.8.0 pip-tools pkginfo==1.8.3 placebo platformdirs==2.5.2 poetry==1.1.13 poetry-core==1.0.8 ptyprocess==0.7.0 pyasn1==0.4.8 pycparser==2.21 pylev==1.4.0 pyparsing==3.0.9 python-dateutil==2.8.2 python-slugify==6.1.2 PyYAML requests requests-toolbelt==0.9.1 rsa==4.7.2 s3transfer==0.6.0 SecretStorage==3.3.2 shellingham==1.4.0 six==1.16.0 sqlparse==0.4.2 text-unidecode==1.3 toml==0.10.2 tomlkit==0.11.0 tqdm==4.64.0 troposphere==4.0.2 urllib3==1.26.9 virtualenv==20.14.1 webencodings==0.5.1 Werkzeug==2.1.2 wsgi-request-logger==0.4.6 zappa==0.54.1 zipp==3.8.0

  • Your zappa_settings.json:

{
    "dev": {
        "django_settings": "lambda_test.settings",
        "profile_name": "servers",
        "project_name": "lambda-test",
        "aws_region": "eu-central-1",
        "s3_bucket": "zappa-pna2kvovs",
        "lambda_description": "Zappa + Docker + Django"
    }
}

abtinmo avatar Jun 13 '22 16:06 abtinmo

Hi @abtinmo You can try the docs here This post uses LambCI image. If you need any help further please feel free to ping. i have a simple docker file which I'm using for multiple deployments.

souravjamwal77 avatar Aug 01 '22 12:08 souravjamwal77

Hi there! Unfortunately, this Issue has not seen any activity for at least 90 days. If the Issue is still relevant to the latest version of Zappa, please comment within the next 10 days if you wish to keep it open. Otherwise, it will be automatically closed.

github-actions[bot] avatar Apr 03 '24 18:04 github-actions[bot]

Hi there! Unfortunately, this Issue was automatically closed as it had not seen any activity in at least 100 days. If the Issue is still relevant to the latest version of Zappa, please open a new Issue.

github-actions[bot] avatar Apr 13 '24 20:04 github-actions[bot]