2018-09-11 14:11:24 +03:00
|
|
|
Securing the GraphQL endpoint (Docker)
|
|
|
|
======================================
|
|
|
|
|
|
|
|
To make sure that your GraphQL endpoint and the Hasura console are not publicly accessible, you need to
|
|
|
|
configure an access key.
|
|
|
|
|
2018-11-23 12:17:31 +03:00
|
|
|
Run the docker command with an access-key env var
|
|
|
|
-------------------------------------------------
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
.. code-block:: bash
|
2018-11-23 12:17:31 +03:00
|
|
|
:emphasize-lines: 5
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
#! /bin/bash
|
2018-11-23 12:17:31 +03:00
|
|
|
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
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
|
|
|
If you're looking at adding authentication and access control to your GraphQL API then head
|
|
|
|
to :doc:`Authentication / access control <../../auth/index>`.
|