providers = ["python"]

[build]

[phases.install]
cmds = [
    "python -m venv --copies /opt/venv",
    ". /opt/venv/bin/activate",
    "pip install poetry==$NIXPACKS_POETRY_VERSION",
    "poetry install --no-interaction --no-ansi"
]

[start]
cmd = "poetry run python manage.py migrate && poetry run python manage.py collectstatic --noinput && poetry run python -m gunicorn kyc.wsgi:application --bind 0.0.0.0:${PORT:-8000}"

[variables]
# Set Poetry version to match local environment
NIXPACKS_POETRY_VERSION = "2.2.1"
