#!/bin/bash -x

/usr/bin/wait_on_postgres.py
/usr/bin/wait_on_database_migrations.sh

# NOTE: Due to the Linux dual-stack functionality, this will listen on both IPv4
# IPv6, even though netstat may seem to indicate it is IPv6 only.
# Due to containers using network namespaces, even if the host has this disabled
# with /proc/sys/net/ipv6/bindv6only=1, the container will still have
# it enabled with /proc/sys/net/ipv6/bindv6only=0 .
exec gunicorn pulpcore.content:server \
--bind '[::]:24816' \
--worker-class 'aiohttp.GunicornWebWorker' \
-w 2 \
--access-logfile -
