From 1ab9b776facb747a52dae6e5fe19eac0763b3220 Mon Sep 17 00:00:00 2001
From: Antoine Lambert <anlambert@softwareheritage.org>
Date: Tue, 14 Mar 2023 13:56:41 +0100
Subject: [PATCH] docker: Move graphql service in main docker-compose file

It is a lightweight service and is getting ready for production so
better moving it in the main docker-compose file.

Also update configuration as there is no keycloak service available
by default in the docker environment and bump max query cost as
it is a testing environment.
---
 docker/conf/graphql.yml           | 11 +++--------
 docker/docker-compose.graphql.yml | 18 ------------------
 docker/docker-compose.yml         | 18 ++++++++++++++++++
 3 files changed, 21 insertions(+), 26 deletions(-)
 delete mode 100644 docker/docker-compose.graphql.yml

diff --git a/docker/conf/graphql.yml b/docker/conf/graphql.yml
index 96caf8f..d9f3af9 100644
--- a/docker/conf/graphql.yml
+++ b/docker/conf/graphql.yml
@@ -11,11 +11,6 @@ debug: yes
 introspection: yes
 
 max_query_cost:
-  anonymous: 500
-
-auth:
-  server: https://auth.softwareheritage.org/auth/
-  realm: SoftwareHeritageStaging
-  client: swh-web
-  cache:
-    url: memory://
+  # no auth by default so bump max_query_cost to ease testing
+  anonymous: 50000
+  user: 50000
diff --git a/docker/docker-compose.graphql.yml b/docker/docker-compose.graphql.yml
deleted file mode 100644
index 84b3e34..0000000
--- a/docker/docker-compose.graphql.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-version: "2.1"
-
-services:
-  swh-graphql:
-    image: swh/stack
-    build: ./
-    depends_on:
-      - swh-storage
-    ports:
-      - 5013:5013
-    environment:
-      SWH_CONFIG_FILENAME: /graphql.yml
-    env_file:
-      - ./env/common_python.env
-    volumes:
-      - "./conf/graphql.yml:/graphql.yml:ro"
-      - "./services/swh-graphql/entrypoint.sh:/entrypoint.sh:ro"
-    entrypoint: /entrypoint.sh
diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml
index 5a1df2d..008cfef 100644
--- a/docker/docker-compose.yml
+++ b/docker/docker-compose.yml
@@ -700,6 +700,24 @@ services:
       - "./conf/search_journal_client_indexed.yml:/etc/softwareheritage/search/journal_client.yml:ro"
       - "./services/swh-search-journal-client/entrypoint.sh:/entrypoint.sh:ro"
 
+  # GraphQL API
+
+  swh-graphql:
+    image: swh/stack
+    build: ./
+    depends_on:
+      - swh-storage
+    ports:
+      - 5013:5013
+    environment:
+      SWH_CONFIG_FILENAME: /graphql.yml
+    env_file:
+      - ./env/common_python.env
+    volumes:
+      - "./conf/graphql.yml:/graphql.yml:ro"
+      - "./services/swh-graphql/entrypoint.sh:/entrypoint.sh:ro"
+    entrypoint: /entrypoint.sh
+
 volumes:
   redis-data:
   storage-data:
-- 
GitLab