From 9a00be2515a03a7f4a200e218a70a1ea1e0b1124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Fri, 8 Sep 2023 10:17:24 +0200 Subject: [PATCH 1/2] Top-level `docker-compose.yml` * moved `docker-compose.yml` to the top-level dir * fixed relative paths accordingly * removed `container_name` properties * replaced host port numbers with env variables with default values --- .../docker-compose.yml => docker-compose.yml | 23 ++++++++----------- 1 file changed, 10 insertions(+), 13 deletions(-) rename dockerfiles/docker-compose.yml => docker-compose.yml (67%) diff --git a/dockerfiles/docker-compose.yml b/docker-compose.yml similarity index 67% rename from dockerfiles/docker-compose.yml rename to docker-compose.yml index 821b58e31..8c2d78e53 100644 --- a/dockerfiles/docker-compose.yml +++ b/docker-compose.yml @@ -2,10 +2,9 @@ version: '3.7' services: fuseki: - container_name: skosmos-fuseki hostname: fuseki build: - context: ../dockerfiles/jena-fuseki2-docker + context: ./dockerfiles/jena-fuseki2-docker dockerfile: Dockerfile args: JENA_VERSION: 4.8.0 @@ -13,38 +12,36 @@ services: environment: - JAVA_OPTIONS=-Xmx2g -Xms1g ports: - - '9030:3030' + - ${FUSEKI_PORT:-9030}:3030 volumes: # You can uncomment the lines below to persist data used in the # container. For more complete documentation about it, please # consult the official Apache Jena docs at # https://github.com/apache/jena/tree/main/jena-fuseki2/jena-fuseki-docker - # - ./databases:/fuseki/databases - # - ./logs:/fuseki/logs - - ./config/skosmos.ttl:/fuseki/skosmos.ttl + # - ./dockerfiles/databases:/fuseki/databases + # - ./dockerfiles/logs:/fuseki/logs + - ./dockerfiles/config/skosmos.ttl:/fuseki/skosmos.ttl user: 'fuseki:fuseki' fuseki-cache: - container_name: skosmos-fuseki-cache hostname: fuseki-cache image: varnish ports: - - '9031:80' + - ${CACHE_PORT:-9031}:80 volumes: - type: bind - source: ./config/varnish-default.vcl + source: ./dockerfiles/config/varnish-default.vcl target: /etc/varnish/default.vcl skosmos: - container_name: skosmos-web hostname: skosmos build: - context: .. + context: . dockerfile: dockerfiles/Dockerfile.ubuntu ports: - - '9090:80' + - ${SKOSMOS_PORT:-9090}:80 depends_on: - fuseki - fuseki-cache volumes: - type: bind - source: ./config/config-docker-compose.ttl + source: ./dockerfiles/config/config-docker-compose.ttl target: /var/www/html/config.ttl From 0c0c439033ff96930d935065b7ea2adaa8cb4930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martynas=20Jusevi=C4=8Dius?= Date: Tue, 31 Oct 2023 10:06:38 +0100 Subject: [PATCH 2/2] Updated Docker Compose documentation Aligned with the new `docker-compose.yml` location --- dockerfiles/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dockerfiles/README.md b/dockerfiles/README.md index 830fc59c9..d26ca1764 100644 --- a/dockerfiles/README.md +++ b/dockerfiles/README.md @@ -99,10 +99,13 @@ extension. **NOTE**: `fuseki:3030` and `fuseki-cache:80` are from the internal Docker network. To the host machine Docker Compose is exposing these values as `localhost:3030` -and `localhost:9031` respectively. +and `localhost:9031` respectively. The default host port numbers can be overriden +by setting `SKOSMOS_PORT`, `FUSEKI_PORT`, and `CACHE_PORT` env variables in an +`.env` file. This is useful when running multiple Skosmos Docker Compose instances +on the same host but with different port numbers. To create the containers in this example setup, you can use this command -from the `./dockerfiles/` directory: +from the parent directory (where `docker-compose.yml` is located): docker compose up -d