mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-17 12:31:52 +03:00
30 lines
863 B
ReStructuredText
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>`.
|