Overview
This template provides a production‑ready Hasura stack as a Monk runnable. You can:- Run it directly to get a managed Hasura deployment with PostgreSQL metadata storage
- Inherit it in your own runnable to seamlessly add instant GraphQL APIs to your databases
What this template manages
- Hasura GraphQL Engine container (
hasura/graphql-engineimage) - PostgreSQL database for metadata storage
- Network service on port 8080 (Hasura Console & GraphQL endpoint)
- Real-time GraphQL subscriptions
- Authorization and authentication
- Persistent volumes for data storage
Quick start (run directly)
- Load templates
- Run Hasura stack
- Access the Hasura Console
http://localhost:8080/console to access the Hasura Console.
Default admin secret: monk (recommended to change in production via inheritance)
- Connect your databases
Configuration
Key variables you can customize in this template:${monk-volume-path}/growthbook on the host.
Use by inheritance (recommended for apps)
Inherit the Hasura stack in your application and declare connections. Example:Stack components
hasura/hasura- Hasura GraphQL Engine (port 8080)hasura/hasura-db- PostgreSQL database for metadata storage (port 5432)
Ports and connectivity
- Service:
hasura-svcon TCP port8080(GraphQL API & Console) - Metadata DB:
hasura-db-svcon TCP port5432(internal use) - From other runnables in the same process group, use
connection-hostname("\<connection-name>")to resolve the Hasura host.
http://\<hasura-host>:8080/v1/graphql
Console: http://\<hasura-host>:8080/console
Persistence and configuration
- Data path:
${monk-volume-path}/growthbook:/usr/local/src/app/packages/back-end/uploads - PostgreSQL metadata is stored in the
hasura-dbcontainer’s internal volumes - You can customize Hasura behavior through environment variables (see Configuration section)
Features
- Instant GraphQL APIs on existing databases
- Real-time GraphQL subscriptions with live queries
- Authorization with row-level security and role-based access control
- Remote schemas to stitch external GraphQL APIs
- Actions to extend your schema with custom business logic
- Event triggers for asynchronous business logic
- Scheduled triggers for cron-like functionality
- Database migrations and schema management
Related templates
- See other templates in this repository for complementary services
- Combine with
postgresql/for your primary application database - Integrate with
redis/for caching and rate limiting - Use with monitoring tools (
prometheus-grafana/) for observability - Pair with authentication services for complete auth workflows
Troubleshooting
- If you changed
hasura_admin_secretbut can’t access the console, ensure you’re using the correct secret in thex-hasura-admin-secretheader or console login. - Ensure the metadata database is healthy before Hasura starts. The template includes a readiness check and
wait-fordependency. - For production deployments, disable dev mode (
hasura_graphql_dev: false) and consider disabling the console (hasura_graphql_cnsl: false). - Check Hasura logs:
- Check PostgreSQL metadata database logs:
- Check stack health: