How to enable AMP for custom single template with custom database

How to enable AMP for custom single template with custom database