From 57ae3eab3a47991b1507651e3a661ac5dee86129 Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 09:32:49 +0200 Subject: [PATCH 1/7] [#50] Move docker-compose.yml to deploy/docker-compose.yml --- .../docker-compose.yml | 2 +- docker-compose-dev.yml | 76 ------------------- 2 files changed, 1 insertion(+), 77 deletions(-) rename docker-compose.yml => deploy/docker-compose.yml (98%) delete mode 100644 docker-compose-dev.yml diff --git a/docker-compose.yml b/deploy/docker-compose.yml similarity index 98% rename from docker-compose.yml rename to deploy/docker-compose.yml index 330b37d..2212692 100644 --- a/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -53,7 +53,7 @@ services: db-server: build: - context: ./deploy/db-server + context: db-server expose: - "7200" volumes: diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml deleted file mode 100644 index 8ce4014..0000000 --- a/docker-compose-dev.yml +++ /dev/null @@ -1,76 +0,0 @@ -version: "3" - -services: - s-pipes-editor-ui: - image: "ghcr.io/kbss-cvut/s-pipes-editor-ui/s-pipes-editor-ui:latest" - container_name: s-pipes-editor-ui - ports: - - "3000:80" - networks: - - overlay - depends_on: - - s-pipes-editor-rest - environment: - - SERVICE_URL=${SPIPES_EDITOR_REST:-http://host.docker.internal:18115} - - s-pipes-editor-rest: - image: "ghcr.io/kbss-cvut/s-pipes-editor/s-pipes-editor:latest" - container_name: s-pipes-editor-rest - ports: - - ${EDITOR_REST_PORT:-18115}:18115 - expose: - - "18115" - networks: - - overlay - depends_on: - - s-pipes-engine - - rdf4j - environment: - - SCRIPTPATHS=${SCRIPTPATHS:-${PWD}/../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../s-pipes/doc/examples}} - - SCRIPTRULES=${SCRIPTRULES:-${PWD}/../s-pipes-editor/src/main/resources/rules} - - ENGINEURL=${SPIPES_ENGINE:-http://host.docker.internal:8081/s-pipes/} - - RDF4J_REPOSITORYURL=${RDF4J_SERVER_URL:-http://rdf4j:8080/rdf4j-server}/repositories - - RDF4J_REPOSITORYNAME=${RDF4J_REPOSITORYNAME:-s-pipes-hello-world} - - RDF4J_PCONFIGURL=${RDF4J_PCONFIGURL:-../s-pipes/doc/examples/hello-world/config.ttl} - volumes: - - /tmp:/tmp - - ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} - - /usr/local/tomcat/temp/:/usr/local/tomcat/temp/ - - s-pipes-engine: - image: "ghcr.io/kbss-cvut/s-pipes/s-pipes-engine:latest" - # container_name: s-pipes-engine - ports: - - ${SPIPES_PORT:-8081}:8080 - expose: - - "8080" - networks: - - overlay - depends_on: - - rdf4j - environment: - - CONTEXTS_SCRIPTPATHS=${SCRIPTPATHS:-${PWD}/../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../s-pipes/doc/examples}} - volumes: - - /tmp:/tmp - - ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} - - /usr/local/tomcat/temp/:/usr/local/tomcat/temp/ - - rdf4j: - image: "eclipse/rdf4j-workbench:3.7.7" - container_name: rdf4j - expose: - - "8080" - networks: - - overlay - environment: - - JAVA_OPTS=-Xms1g -Xmx4g - volumes: - - data:/var/rdf4j - - logs:/usr/local/tomcat/logs - -volumes: - data: - logs: - -networks: - overlay: From c8460f4fd0cf1574a76424bc7642388949ebc9b1 Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 09:41:05 +0200 Subject: [PATCH 2/7] [#50] Add nginx in front of the docker services and correct relative paths in environment variables [#50] Fix formating --- deploy/docker-compose.yml | 56 ++++++++++++++--------- deploy/nginx/error.html | 35 +++++++++++++++ deploy/nginx/nginx.conf | 93 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 164 insertions(+), 20 deletions(-) create mode 100644 deploy/nginx/error.html create mode 100644 deploy/nginx/nginx.conf diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index 2212692..b579e46 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -1,37 +1,50 @@ version: "3.9" -# Expose port to access s-pipes-editor-rest directly -x-access-db-server-development-port: &s-pipes-editor-rest-dev-port - ports: - - "127.0.0.1:${EDITOR_REST_PORT:-18115}:18115" - services: + nginx: + image: nginx:latest + ports: + - "127.0.0.1:${INTERNAL_HOST_PORT:-1235}:80" + restart: unless-stopped + depends_on: + - s-pipes-engine + - s-pipes-editor-rest + - db-server + - s-pipes-editor-ui + environment: + NGINX_ENVSUBST_OUTPUT_DIR: "/etc/nginx" + APP_ORIGIN: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}" + SERVICE_URL: "${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115}" + volumes: + - ./nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template:ro + - ./nginx/error.html:/usr/share/nginx/html/error.html:ro + s-pipes-editor-ui: image: "ghcr.io/kbss-cvut/s-pipes-editor-ui/s-pipes-editor-ui:latest" - container_name: s-pipes-editor-ui - ports: - - "127.0.0.1:${INTERNAL_HOST_PORT:-3000}:80" + expose: + - "80" + restart: unless-stopped depends_on: - s-pipes-editor-rest environment: - - SERVICE_URL=${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115} + SERVICE_URL: "${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115}" s-pipes-editor-rest: # <<: *s-pipes-editor-rest-dev-port image: "ghcr.io/kbss-cvut/s-pipes-editor/s-pipes-editor:latest" - container_name: s-pipes-editor-rest expose: - "18115" + restart: unless-stopped depends_on: - s-pipes-engine - db-server environment: - - SCRIPTPATHS=${SCRIPTPATHS:-${PWD}/../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../s-pipes/doc/examples}} - - SCRIPTRULES=${SCRIPTRULES:-${PWD}/../s-pipes-editor/src/main/resources/rules} - - ENGINEURL=${SPIPES_ENGINE:-http://s-pipes-engine:8080/s-pipes}/ - - RDF4J_REPOSITORYURL=${RDF4J_SERVER_URL:-http://db-server:7200}/repositories - - RDF4J_REPOSITORYNAME=${RDF4J_REPOSITORYNAME:-s-pipes-hello-world} - - RDF4J_PCONFIGURL=${RDF4J_PCONFIGURL:-${PWD}/deploy/s-pipes-engine/config.ttl} + SCRIPTPATHS: "${SCRIPTPATHS:-${PWD}/../../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../../s-pipes/doc/examples}}" + SCRIPTRULES: "${SCRIPTRULES:-${PWD}/../../s-pipes-editor/src/main/resources/rules}" + ENGINEURL: "${SPIPES_ENGINE:-http://s-pipes-engine:8080/s-pipes}/" + RDF4J_REPOSITORYURL: "${RDF4J_SERVER_URL:-http://db-server:7200}/repositories" + RDF4J_REPOSITORYNAME: "${RDF4J_REPOSITORYNAME:-s-pipes-hello-world}" + RDF4J_PCONFIGURL: "${RDF4J_PCONFIGURL:-./s-pipes-engine/config.ttl}" volumes: - /tmp:/tmp - ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} @@ -39,13 +52,13 @@ services: s-pipes-engine: image: "ghcr.io/kbss-cvut/s-pipes/s-pipes-engine:latest" - # container_name: s-pipes-engine expose: - "8080" + restart: unless-stopped depends_on: - db-server environment: - - CONTEXTS_SCRIPTPATHS=${SCRIPTPATHS:-${PWD}/../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../s-pipes/doc/examples}} + CONTEXTS_SCRIPTPATHS: "${SCRIPTPATHS:-${PWD}/../../s-pipes-modules;${CUSTOM_SCRIPT_PATHS:-${PWD}/../../s-pipes/doc/examples}}" volumes: - /tmp:/tmp - ${SHARED_ROOT:-/home}:${SHARED_ROOT:-/home} @@ -53,11 +66,14 @@ services: db-server: build: - context: db-server + context: ./db-server expose: - "7200" + restart: unless-stopped + environment: + GDB_JAVA_OPTS: "-Dgraphdb.external-url=${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}/services/db-server" volumes: - - ./deploy/db-server/init-config:/repo-config:ro + - ./db-server/init-config:/repo-config:ro - db-server:/opt/graphdb/home volumes: diff --git a/deploy/nginx/error.html b/deploy/nginx/error.html new file mode 100644 index 0000000..5a4f368 --- /dev/null +++ b/deploy/nginx/error.html @@ -0,0 +1,35 @@ + + + + + + <!--# echo var="status" default="" --> | SPiper Editor + + + + + + + + +

The application is currently being updated

+

You will be redirected to the new version in a few seconds.

+

If you see this message for more than a minute, something has gone wrong.

+ +

Sorry, something went wrong.

+

+ + + diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf new file mode 100644 index 0000000..4734310 --- /dev/null +++ b/deploy/nginx/nginx.conf @@ -0,0 +1,93 @@ +worker_processes 1; + +events +{ + worker_connections 1024; +} + +http +{ + + client_max_body_size 100M; + + include mime.types; + default_type application/octet-stream; + + map $status $status_text + { + 400 'Bad Request'; + 401 'Unauthorized'; + 403 'Forbidden'; + 404 'Not Found'; + 405 'Method Not Allowed'; + 406 'Not Acceptable'; + 413 'Payload Too Large'; + 414 'URI Too Long'; + 431 'Request Header Fields Too Large'; + 500 'Internal Server Error'; + 501 'Not Implemented'; + 502 'Bad Gateway'; + 503 'Service Unavailable'; + 504 'Gateway Timeout'; + } + + server + { + listen 80; + server_name localhost; + error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 + 415 416 417 418 421 422 423 424 426 428 429 431 451 500 501 502 503 + 504 505 506 507 508 510 511 /error.html; + + location = /error.html { + ssi on; + internal; + root /usr/share/nginx/html; + } + + location / { + proxy_pass http://s-pipes-editor-ui; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + } + + location = /rest { + return 302 ${APP_ORIGIN}/rest/; + } + + location /rest/ { + proxy_pass ${SERVICE_URL}/og_spipes/rest/; + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection 'upgrade'; + proxy_set_header Host $host; + proxy_cache_bypass $http_upgrade; + } + + location = /services/db-server { + return 302 ${APP_ORIGIN}/services/db-server/; + } + + location /services/db-server/ + { + proxy_pass http://db-server:7200/; + } + + location = /services/s-pipes { + return 302 ${APP_ORIGIN}/services/s-pipes/; + } + + location /services/s-pipes/ { + proxy_pass http://s-pipes-engine:8080/; + } + + location /health-check + { + return 200; + access_log off; + } + + } +} \ No newline at end of file From 15194755354eb01bc75ec9e39a5a161eb59f2716 Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 09:42:40 +0200 Subject: [PATCH 3/7] [#50] Move nginx.conf to /deploy/.docker --- Dockerfile | 6 +++--- .../.docker/docker-entrypoint.sh | 0 nginx.conf => deploy/.docker/nginx.conf | 9 +-------- 3 files changed, 4 insertions(+), 11 deletions(-) rename docker-entrypoint.sh => deploy/.docker/docker-entrypoint.sh (100%) rename nginx.conf => deploy/.docker/nginx.conf (86%) diff --git a/Dockerfile b/Dockerfile index 5f47ab3..be3c432 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ WORKDIR /app # will be cached unless changes to one of those two files # are made. COPY package.json package-lock.json ./ -RUN npm install --legacy-peer-deps +RUN npm install # Copy the main application COPY ./ /app/ @@ -33,12 +33,12 @@ COPY --from=build /app/dist /var/www COPY ./public /var/www/public # Copy our custom nginx config -COPY nginx.conf /etc/nginx/nginx.conf.template +COPY deploy/.docker/nginx.conf /etc/nginx/nginx.conf.template # Expose port 80 to the Docker host, so we can access it # from the outside. EXPOSE 80 -COPY docker-entrypoint.sh / +COPY deploy/.docker/docker-entrypoint.sh / ENTRYPOINT ["/docker-entrypoint.sh"] CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/docker-entrypoint.sh b/deploy/.docker/docker-entrypoint.sh similarity index 100% rename from docker-entrypoint.sh rename to deploy/.docker/docker-entrypoint.sh diff --git a/nginx.conf b/deploy/.docker/nginx.conf similarity index 86% rename from nginx.conf rename to deploy/.docker/nginx.conf index 018b50a..1bc5772 100644 --- a/nginx.conf +++ b/deploy/.docker/nginx.conf @@ -65,13 +65,6 @@ try_files $uri =404; } - location /rest/ { - proxy_pass ${SERVICE_URL}/og_spipes/rest/; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; - } + } } From c2511075c715dfd77c4afd2a62103e0e9efc9b2d Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 09:44:31 +0200 Subject: [PATCH 4/7] [#50] Correct the paths in the scripts for running docker-compose --- bin/spe.bat | 2 +- bin/spe.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/bin/spe.bat b/bin/spe.bat index 12faba7..0823472 100644 --- a/bin/spe.bat +++ b/bin/spe.bat @@ -37,7 +37,7 @@ for %%A in (%*) do ( ) ) ) -cd %PROJECT_DIR% +cd %PROJECT_DIR%/deploy echo starting s-pipes-editor-ui with scripts %CUSTOM_SCRIPT_PATHS% docker-compose --env-file=.env.custom-script-paths up :eof diff --git a/bin/spe.sh b/bin/spe.sh index 0b781ad..5176427 100755 --- a/bin/spe.sh +++ b/bin/spe.sh @@ -33,8 +33,7 @@ done - -cd $PROJECT_DIR +cd $PROJECT_DIR/deploy CUSTOM_SCRIPT_PATHS="$CUSTOM_SCRIPT_PATHS" docker-compose --env-file=.env.custom-script-paths up cd From ca6edf6aa069c70dc3c1111ab437e90f420ff135 Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 09:45:05 +0200 Subject: [PATCH 5/7] [#50] Add .env files to the /deploy folder --- deploy/.env | 4 ++++ .env.custom-script-paths => deploy/.env.custom-script-paths | 0 2 files changed, 4 insertions(+) create mode 100644 deploy/.env rename .env.custom-script-paths => deploy/.env.custom-script-paths (100%) diff --git a/deploy/.env b/deploy/.env new file mode 100644 index 0000000..2502236 --- /dev/null +++ b/deploy/.env @@ -0,0 +1,4 @@ +#INTERNAL_HOST_PORT=1235 +#PUBLIC_ORIGIN=http://localhost +#SPIPES_ENGINE=http://s-pipes-engine:8080/s-pipes/ +#SPIPES_EDITOR_REST=s-pipes-editor-rest:18115 diff --git a/.env.custom-script-paths b/deploy/.env.custom-script-paths similarity index 100% rename from .env.custom-script-paths rename to deploy/.env.custom-script-paths From 579bfe897ad3b75461e293e2d0c2143cf2930048 Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 09:45:18 +0200 Subject: [PATCH 6/7] [#50] Correct README.md --- README.md | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 8e5efa8..0093e88 100644 --- a/README.md +++ b/README.md @@ -22,19 +22,19 @@ There are two ways to run the editor, [using docker-compose](#running-editor-usi #### Running editor using docker-compose To run the editor using `docker-compose`, do the following steps: -- `cd $PROJECT_ROOT` -- if on Windows, create `$PROJECT_ROOT/.env` according to [Configuration of environment variables in Windows](#configuration-of-environment-variables-in-windows) +- `cd $PROJECT_ROOT/deploy +- if on Windows, create `$PROJECT_ROOT/deploy/.env` according to [Configuration of environment variables in Windows](#configuration-of-environment-variables-in-windows) - `docker-compose up` -- open the editor in browser at `http://localhost:3000`. The editor should be showing [example scripts from SPipes repository](https://github.com/kbss-cvut/s-pipes/doc/examples). +- open the editor in browser at `http://localhost:1235`. The editor should be showing [example scripts from SPipes repository](https://github.com/kbss-cvut/s-pipes/doc/examples). #### Run editor using spe script -`spe` script can be used to execute the editor from a command line by specifying one or more directories from which SPipes scripts should be loaded. Internally the script uses [docker-compose.yml](https://github.com/kbss-cvut/s-pipes-editor-ui/blob/master/docker-compose.yml) file and environment variables specified in `$PROJECT_ROOT/.env.custom-script-paths`. +`spe` script can be used to execute the editor from a command line by specifying one or more directories from which SPipes scripts should be loaded. Internally the script uses [docker-compose.yml](https://github.com/kbss-cvut/s-pipes-editor-ui/blob/master/docker-compose.yml) file and environment variables specified in `$PROJECT_ROOT/deploy/.env.custom-script-paths`. To run the editor using `spe` script, do the following steps: -- if on Windows, create `$PROJECT_ROOT/.env.custom-script-paths` according to [Configuration of environment variables in Windows](#configuration-of-environment-variables-in-windows) +- if on Windows, create `$PROJECT_ROOT/deploy/.env.custom-script-paths` according to [Configuration of environment variables in Windows](#configuration-of-environment-variables-in-windows) - `$PROJECT_ROOT/bin/spe.$EXTENSION ` -- open the editor in a browser at `http://localhost:3000`. The editor should show the script from folders specified in and the folder $PROJECT_ROOT/../s-pipes-modules. +- open the editor in a browser at `http://localhost:1235`. The editor should show the script from folders specified in and the folder $PROJECT_ROOT/../s-pipes-modules. Use the correct spe script extension: - Use `spe.sh` if in bash (both linux or wsl distribution). @@ -54,13 +54,13 @@ To make the script executable line endings should be replaced. - `SHARED_ROOT=/mnt/c` -To override default configuration create `$PROJECT_ROOT/.env` and use following variables: +To override default configuration create `$PROJECT_ROOT/deploy/.env` and use following variables: - `CUSTOM_SCRIPT_PATHS` -- to show different SPipes scripts (defaults to `${PROJECT_ROOT}/../s-pipes/doc/examples`). Use separator ";" to add multiple paths. The path must be absolute and the same as in host filesystem. - `SCRIPTRULES` -- to set up different rules to validate SPipes scripts (defaults to `${PROJECT_ROOT}/../s-pipes-editor/src/main/resources/rules`), -- `RDF4J_SERVER_URL` -- to set up different Rdf4j server (defaults to internal docker service at `http://rdf4j:8080/rdf4j-server`). - **Note that this variable must be consistent with variable `RDF4J_PCONFIGURL`**. +- `RDF4J_SERVER_URL` -- to set up different Rdf4j server (defaults to internal docker service at `http://db-server:7200/`). + **Note that this variable must be consistent with variable `RDF4J_PCONFIGURL`**. - `RDF4J_REPOSITORYNAME` -- to set up different Rdf4j repository name where SPipes logs from execution are created (defaults to `s-pipes-hello-world`). **Note that this variable must be consistent with variable `RDF4J_PCONFIGURL`**. @@ -69,7 +69,8 @@ To override default configuration create `$PROJECT_ROOT/.env` and use following variables `RDF4J_SERVER_URL` and `RDF4J_REPOSITORYNAME`**. - `SPIPES_ENGINE` -- to set up different s-pipes engine (defaults to internal docker service `http://s-pipes-engine:8080/s-pipes/`), - `SPIPES_EDITOR_REST` -- to set up different s-pipes-editor backend (defaults to internal docker service `s-pipes-editor-rest:18115`). - +- `INTERNAL_HOST_PORT` -- to set the port number on which application will be accessible within the internal network (defaults to internal docker service `1235`) +- `PUBLIC_ORIGIN` -- to set the base URL or domain where the application is publicly accessible. ### Building @@ -95,10 +96,10 @@ $ npm run dev ## Development with Docker Compose Here is the common procedure to debug individual services of the s-pipes-editor-ui. `` can be replaced by one of the values `s-pipes-editor-ui`, `s-pipes-editor-rest` and `s-pipes-engine`. -1. cd to `$PROJECT_ROOT`. -2. Run `docker-compose -f docker-compose-dev.yml up` if not running already. Otherwise, run -`docker-compose -f docker-compose-dev.yml start`. -3. Stop the service which you want to develop `docker-compose -f docker-compose-dev.yml stop ` +1. cd to `$PROJECT_ROOT/deploy`. +2. Run `docker-compose up` if not running already. Otherwise, run +`docker-compose start`. +3. Stop the service which you want to develop `docker-compose stop ` 4. Start `` in development environment - `s-pipes-editor-ui` - run `npm run dev` - `s-pipes-editor-rest` - start run/debug springboot configuration in IntelliJ IDEA @@ -115,16 +116,16 @@ where denotes the URL where SPipes backend is running. ### Docker-compose You can run editor together with backend using docker orchestration. The docker-compose is composed of 4 services and can be run via `docker-compose up`: -* [chlupnoha/s-pipes-editor-ui:latest](https://hub.docker.com/repository/docker/chlupnoha/s-pipes-editor-ui) - accessible on `http://localhost:3000` -* [chlupnoha/s-pipes-editor-rest:latest](https://hub.docker.com/repository/docker/chlupnoha/s-pipes-editor-rest) - accessible on `http://localhost:18115` with [configuration options](https://github.com/kbss-cvut/s-pipes-editor#dockerization) -* [chlupnoha/spipes-engine:latest](https://hub.docker.com/repository/docker/chlupnoha/spipes-engine) - accessible on `http://localhost:8081` with [configuration options](https://github.com/kbss-cvut/s-pipes#dockerization) -* [eclipse/rdf4j-workbench:amd64-3.5.0](https://hub.docker.com/r/eclipse/rdf4j-workbench) - accessible on `http://localhost:8080/rdf4j-workbench` +* [kbss-cvut/s-pipes-editor-ui:latest](https://ghcr.io/kbss-cvut/s-pipes-editor/s-pipes-editor-ui:latest) - accessible on `http://localhost:1235` +* [kbss-cvut/s-pipes-editor-rest:latest](https://ghcr.io/kbss-cvut/s-pipes-editor/s-pipes-editor:latest) - accessible on `http://localhost:1235/rest` +* [kbss-cvut/spipes-engine:latest](https://ghcr.io/kbss-cvut/s-pipes-engine/s-pipes-engine:latest) - accessible on `http://localhost:1235/services/s-pipes` +* [graphdb](./deploy/db-server) - accessible on `http://localhost:1235/services/db-server` **Required manual steps:** * s-pipes-engine - * The service does not automatically create the repository in RDF4J, so manual creation of a repository is required (after running `docker-compose up`). - * First open the RDF4J Workbench: `http://localhost:/rdf4j-workbench` where `` is the RDF4J service port specified in `docker-compose.yml`. - * Then follow these instructions: [Creating a Repository](https://rdf4j.org/documentation/tools/server-workbench/#:~:text=for%20the%20repository.-,Creating%20a%20Repository,-Click%20on%20%E2%80%9CNew) (For repository type use for example Native Store.) + * The service does not automatically create the repository in GraphDB, so manual creation of a repository is required (after running `docker-compose up`). + * First open the GraphDB Workbench: `http://localhost:/services/db-server/repository` where `` is the port specified in `.env`. + * Then follow these [instructions](https://graphdb.ontotext.com/documentation/10.0/creating-a-repository.html). * The logging configuration for RDF4j is hardcoded in the image, but it could override via `_pConfigURL` param. However, it is not a convenient format to work. Also both servies must to share volume or the config has to be exposed. * Notes From 4d83e0464ae5588f3786d5c1fb981b41c9697cff Mon Sep 17 00:00:00 2001 From: Daniil Palagin Date: Wed, 18 Sep 2024 11:20:54 +0200 Subject: [PATCH 7/7] [#50] Rename SERVICE_URL to SPIPES_EDITOR_REST_SERVICE_URL for nginx service --- deploy/docker-compose.yml | 2 +- deploy/nginx/nginx.conf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy/docker-compose.yml b/deploy/docker-compose.yml index b579e46..2f4cead 100644 --- a/deploy/docker-compose.yml +++ b/deploy/docker-compose.yml @@ -14,7 +14,7 @@ services: environment: NGINX_ENVSUBST_OUTPUT_DIR: "/etc/nginx" APP_ORIGIN: "${PUBLIC_ORIGIN:-http://localhost:${INTERNAL_HOST_PORT:-1235}}" - SERVICE_URL: "${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115}" + SPIPES_EDITOR_REST_SERVICE_URL: "${SPIPES_EDITOR_REST:-http://s-pipes-editor-rest:18115}" volumes: - ./nginx/nginx.conf:/etc/nginx/templates/nginx.conf.template:ro - ./nginx/error.html:/usr/share/nginx/html/error.html:ro diff --git a/deploy/nginx/nginx.conf b/deploy/nginx/nginx.conf index 4734310..98f2db6 100644 --- a/deploy/nginx/nginx.conf +++ b/deploy/nginx/nginx.conf @@ -58,7 +58,7 @@ http } location /rest/ { - proxy_pass ${SERVICE_URL}/og_spipes/rest/; + proxy_pass ${SPIPES_EDITOR_REST_SERVICE_URL}/og_spipes/rest/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade';