visit http://portainer.readthedocs.io/en/stable/templates.html to know syntax to create json file to custom template
problem with custom app
If you run portainer with http, some time you have problem can't get template via network. please check network and dns server.
I run portainer with https via traefik, I recommend you host custom template app with https.
Finnaly, edit link app template in setting portainer. You can see your app in App template tab :))))