Alexey Kim 1 year ago
parent
commit
e9ca36947e
3 changed files with 82 additions and 0 deletions
  1. 48 0
      devops/docker-compose.yaml
  2. 2 0
      devops/mariadb.cnf
  3. 32 0
      devops/router.yaml

+ 48 - 0
devops/docker-compose.yaml

@@ -0,0 +1,48 @@
+version: '3'
+
+services:
+  database:
+    container_name: database
+    hostname: database
+    image: bitnami/mariadb:10.9
+    environment:
+      - MARIADB_EXTRA_FLAGS=--max-connect-errors=100 --max_connections=155
+      - MARIADB_ROOT_USER=master
+      - MARIADB_ROOT_PASSWORD=Izene@123
+      - MARIADB_DATABASE=craft
+      - MARIADB_SKIP_TEST_DB=yes
+      - MARIADB_REPLICATION_MODE=master
+      - MARIADB_REPLICATION_USER=repl
+      - MARIADB_REPLICATION_PASSWORD=izene123
+      - MARIADB_USER=beejay
+      - MARIADB_PASSWORD=964682
+    volumes:
+      - ./data/mariadb:/bitnami/mariadb
+      - ./mariadb.cnf:/opt/bitnami/mariadb/conf/my_custom.cnf:ro
+    ports:
+      - "3306:3306"
+    restart: unless-stopped
+
+  router:
+    container_name: router
+    image: ghcr.io/apollographql/router:v1.24.0
+    volumes:
+      - ./prod-schema.graphql:/etc/config/supergraph.graphql:ro
+      - ./router.yaml:/etc/config/configuration.yaml:ro
+    command:
+      [
+        "-c",
+        "/etc/config/configuration.yaml",
+        "-s",
+        "/etc/config/supergraph.graphql",
+        "--log",
+        "info",
+        "--hot-reload",
+        "--anonymous-telemetry-disabled",
+        "--listen",
+        "0.0.0.0:3128"
+      ]
+    ports:
+      - "3128:3128"
+      - "9090:9090"
+    restart: unless-stopped

+ 2 - 0
devops/mariadb.cnf

@@ -0,0 +1,2 @@
+[mysqld]
+max_allowed_packet=32M

+ 32 - 0
devops/router.yaml

@@ -0,0 +1,32 @@
+sandbox:
+  enabled: true
+
+homepage:
+  enabled: false
+
+supergraph:
+  introspection: true
+
+override_subgraph_url:
+  auth: http://host.docker.internal:8080/query
+
+include_subgraph_errors:
+  all: true
+
+traffic_shaping:
+  deduplicate_variables: true
+  router:
+    timeout: 15s
+    global_rate_limit:
+      capacity: 1000
+      interval: 1s
+
+telemetry:
+  metrics:
+    common:
+      service_name: "gateway"
+      service_namespace: "craft"
+    prometheus:
+      listen: 0.0.0.0:9090
+      path: /metrics
+      enabled: true