Stuck with django asgi server (dpahne) and aws eb (with docker)

I’m trying to deploy a Django application that uses Channels + ASGI + Daphne on AWS Elastic Beanstalk with the Docker platform. My container builds successfully, migrations run, and Daphne starts properly on 0.0.0.0:8000. Logs show the ASGI server is running without errors.

The issue is that Elastic Beanstalk is not routing traffic to the Daphne server inside the Docker container.

Here’s what’s happening:

  • docker logs shows Daphne listening on 0.0.0.0:8000

  • The container starts cleanly (no errors)

  • curl <container-ip>:8000/ works

  • curl http://localhost/ on the host does not reach Daphne

  • /health/ returns nothing because Django had no route (fixed now)

  • Elastic Beanstalk environment loads but the site doesn’t respond externally

  • It seems like NGINX inside EB is not proxying requests to the container

I think I need a correct NGINX proxy config or a proper EB .config file that routes traffic to the container’s internal IP/port.

Can someone provide a working example of:

✅ Dockerfile
✅ entrypoint.sh
✅ EB .ebextensions config for ASGI/Daphne
✅ NGINX proxy config for forwarding WebSocket + HTTP traffic
✅ Any extra EB settings needed for Channels

Basically, I need the correct setup so EB can forward all traffic to Daphne inside a Docker container.

Any working sample or guidance would help a lot. I’ve been stuck on this for day

Вернуться на верх