graphql-engine/docs/graphql/manual/deployment/docker/securing-graphql-endpoint.rst
2019-02-06 12:09:36 +05:30

30 lines
863 B
ReStructuredText

Securing the GraphQL endpoint (Docker)
======================================
.. contents:: Table of contents
:backlinks: none
:depth: 1
:local:
To make sure that your GraphQL endpoint and the Hasura console are not publicly accessible, you need to
configure an access key.
Run the docker command with an access-key env var
-------------------------------------------------
.. code-block:: bash
:emphasize-lines: 5
#! /bin/bash
docker run -d -p 8080:8080 \
-e HASURA_GRAPHQL_DATABASE_URL=postgres://username:password@hostname:port/dbname \
-e HASURA_GRAPHQL_ENABLE_CONSOLE=true \
-e HASURA_GRAPHQL_ACCESS_KEY=mysecretkey \
hasura/graphql-engine:latest
.. note::
If you're looking at adding access control rules for your data to your GraphQL API then head
to :doc:`Authentication / access control <../auth/index>`.