2020-01-14 15:57:45 +03:00
|
|
|
.. meta::
|
|
|
|
:description: Get started with Hasura using Docker
|
|
|
|
:keywords: hasura, docs, start, docker
|
|
|
|
|
2020-03-11 22:42:36 +03:00
|
|
|
.. _docker_simple:
|
|
|
|
|
2018-09-11 14:11:24 +03:00
|
|
|
Quickstart with Docker
|
|
|
|
======================
|
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
.. contents:: Table of contents
|
|
|
|
:backlinks: none
|
|
|
|
:depth: 1
|
|
|
|
:local:
|
|
|
|
|
2020-07-31 18:26:55 +03:00
|
|
|
Introduction
|
|
|
|
------------
|
|
|
|
|
2019-09-11 10:17:14 +03:00
|
|
|
This guide will help you get the Hasura GraphQL engine and Postgres running as
|
2018-10-19 19:59:18 +03:00
|
|
|
Docker containers using Docker Compose. This is the easiest way to set up
|
2018-09-11 14:11:24 +03:00
|
|
|
Hasura GraphQL engine on your **local environment**.
|
|
|
|
|
2020-07-31 18:26:55 +03:00
|
|
|
In case you'd like to run Hasura on an existing Postgres database, follow :ref:`this guide <deployment_docker>`
|
|
|
|
to deploy the Hasura GraphQL engine as a standalone docker container and connect it to your Postgres instance.
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
Prerequisites
|
|
|
|
-------------
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
- `Docker <https://docs.docker.com/install/>`_
|
|
|
|
- `Docker Compose <https://docs.docker.com/compose/install/>`_
|
|
|
|
|
|
|
|
Step 1: Get the docker-compose file
|
2020-02-19 14:43:08 +03:00
|
|
|
-----------------------------------
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2020-07-09 11:42:33 +03:00
|
|
|
The `hasura/graphql-engine/install-manifests <https://github.com/hasura/graphql-engine/tree/stable/install-manifests>`__ repo
|
2018-09-11 14:11:24 +03:00
|
|
|
contains all installation manifests required to deploy Hasura anywhere. Get the docker compose file from there:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
2020-06-24 10:15:33 +03:00
|
|
|
# in a new directory run
|
2020-02-19 14:43:08 +03:00
|
|
|
wget https://raw.githubusercontent.com/hasura/graphql-engine/stable/install-manifests/docker-compose/docker-compose.yaml
|
2020-06-24 10:15:33 +03:00
|
|
|
# or run
|
|
|
|
curl https://raw.githubusercontent.com/hasura/graphql-engine/stable/install-manifests/docker-compose/docker-compose.yaml -o docker-compose.yml
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
Step 2: Run Hasura GraphQL engine & Postgres
|
|
|
|
--------------------------------------------
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
$ docker-compose up -d
|
|
|
|
|
|
|
|
Check if the containers are running:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
$ docker ps
|
|
|
|
|
|
|
|
CONTAINER ID IMAGE ... CREATED STATUS PORTS ...
|
|
|
|
097f58433a2b hasura/graphql-engine ... 1m ago Up 1m 8080->8080/tcp ...
|
|
|
|
b0b1aac0508d postgres ... 1m ago Up 1m 5432/tcp ...
|
|
|
|
|
|
|
|
Step 3: Open the Hasura console
|
|
|
|
-------------------------------
|
|
|
|
|
2018-10-19 19:59:18 +03:00
|
|
|
Head to ``http://localhost:8080/console`` to open the Hasura console.
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
Hello World (GraphQL or event triggers)
|
|
|
|
---------------------------------------
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2020-03-11 22:42:36 +03:00
|
|
|
Make your :ref:`first graphql query <first_graphql_query>`
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
OR
|
|
|
|
|
2020-03-11 22:42:36 +03:00
|
|
|
Set up your :ref:`first event trigger <first_event_trigger>`
|
2018-09-11 14:11:24 +03:00
|
|
|
|
2018-12-03 15:12:24 +03:00
|
|
|
Advanced
|
|
|
|
--------
|
2018-09-11 14:11:24 +03:00
|
|
|
|
|
|
|
This was a quickstart guide to get the Hasura GraphQL engine up and running
|
|
|
|
quickly. For more detailed instructions on deploying using Docker, check out
|
2020-03-11 22:42:36 +03:00
|
|
|
:ref:`deployment_docker`.
|
2018-12-16 12:55:06 +03:00
|
|
|
|