gunicorn/examples/http2_gevent/docker-compose.yml
Benoit Chesneau 315e7bde80 fix(http2): ALPN negotiation for gevent/eventlet workers
- Add explicit do_handshake() in base_async.py before ALPN check
  when do_handshake_on_connect is False
- Mark eventlet worker as deprecated (removal in 26.0)
- Add HTTP/2 gevent example with Docker and tests
- Update documentation to reflect eventlet deprecation
- Remove eventlet websocket example (gevent version exists)

The ALPN fix ensures HTTP/2 works correctly with gevent and eventlet
workers when do_handshake_on_connect config is False (the default).
Without explicit handshake, selected_alpn_protocol() returns None.
2026-01-28 13:42:48 +01:00

47 lines
1.1 KiB
YAML

# HTTP/2 with Gevent Docker Compose
#
# Usage:
# # Generate certificates first (or use your own)
# ./generate_certs.sh
#
# # Start services
# docker compose up -d
#
# # Test with curl (requires curl with HTTP/2 support)
# curl -k --http2 https://localhost:8443/
#
# # View logs
# docker compose logs -f
#
# # Stop services
# docker compose down
services:
gunicorn:
build:
context: ../..
dockerfile: examples/http2_gevent/Dockerfile
ports:
- "8443:8443"
volumes:
- ./certs:/certs:ro
environment:
- GUNICORN_WORKERS=4
- GUNICORN_LOG_LEVEL=info
healthcheck:
test: ["CMD", "python", "-c", "import ssl,socket; s=socket.socket(); s.settimeout(2); ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE; ss=ctx.wrap_socket(s,server_hostname='localhost'); ss.connect(('localhost',8443)); ss.close()"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
restart: unless-stopped
deploy:
resources:
limits:
cpus: '2'
memory: 512M
networks:
default:
driver: bridge