From 3bffa7778cc290d0ad7cf9146e9dd9215f30154a Mon Sep 17 00:00:00 2001 From: Nordine Bittich Date: Thu, 18 Mar 2021 09:26:43 +0100 Subject: [PATCH] Metis & frontend --- config/dispatcher/dispatcher.ex | 37 +++++++++++++++++++++++++++++++++ docker-compose.dev.yml | 6 ------ docker-compose.yml | 31 +++++++++++++++++++++++++++ 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/config/dispatcher/dispatcher.ex b/config/dispatcher/dispatcher.ex index fbd0c23..e3b1b50 100644 --- a/config/dispatcher/dispatcher.ex +++ b/config/dispatcher/dispatcher.ex @@ -10,6 +10,43 @@ defmodule Dispatcher do define_layers [ :api, :frontend, :not_found ] + ############################################################### + # sparql endpoint + ############################################################### + match "/sparql/*path", %{ accept: [:any], layer: :api} do + forward conn, path, "http://db:8890/sparql/" + end + + ############################################################### + # ember metis + ############################################################### + get "/uri-info/*path", %{ accept: [:json], layer: :api} do + forward conn, path, "http://uri-info/" + end + + get "/resource-labels/*path", %{ accept: [:json], layer: :api} do + forward conn, path, "http://resource-labels/" + end + + ############################################################### + # frontend layer + ############################################################### + match "/assets/*path", %{ layer: :api } do + Proxy.forward conn, path, "http://frontend/assets/" + end + + match "/@appuniversum/*path", %{ layer: :api } do + Proxy.forward conn, path, "http://frontend/@appuniversum/" + end + + match "/*path", %{ accept: [:html], layer: :api } do + Proxy.forward conn, [], "http://frontend/index.html" + end + + match "/*_path", %{ layer: :frontend } do + Proxy.forward conn, [], "http://frontend/index.html" + end + ############################################################### # errors ############################################################### diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 4398082..304efbb 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -4,9 +4,3 @@ services: web: ports: - "80:80" - triplestore: - ports: - - "8890:8890" - environment: - ENABLE_ENDPOINT_SELECTOR: "true" - DEFAULT_SPARQL_ENDPOINT: "http://localhost:8890/sparql" diff --git a/docker-compose.yml b/docker-compose.yml index 1967be9..6b12c1c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -67,4 +67,35 @@ services: - "logging=true" restart: always logging: *default-logging + # Ember-Metis + uri-info: + image: redpencil/mu-uri-info-service:0.2.0 + links: + - db:database + restart: always + logging: *default-logging + labels: + - "logging=true" + resource-labels-cache: + image: semtech/mu-cache:2.0.1 + links: + - resource-labels:backend + restart: always + logging: *default-logging + labels: + - "logging=true" + resource-labels: + image: lblod/resource-label-service:0.0.3 + links: + - db:database + restart: always + logging: *default-logging + labels: + - "logging=true" + frontend: + image: lblod/frontend-contact-hub + labels: + - "logging=true" + restart: always + logging: *default-logging