Skip to content

Commit

Permalink
Merge pull request #1545 from NatLibFi/issue1541-docker-compose-skosmos3
Browse files Browse the repository at this point in the history
Top-level docker-compose.yml for Skosmos 3
  • Loading branch information
osma authored Nov 14, 2023
2 parents cbd43e4 + d0f2e64 commit 906b920
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
23 changes: 10 additions & 13 deletions dockerfiles/docker-compose.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,48 @@ 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
command: --config=/fuseki/skosmos.ttl
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
security_opt:
- seccomp:unconfined
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
7 changes: 5 additions & 2 deletions dockerfiles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: '3.7'
services:
fuseki:
extends:
file: ../dockerfiles/docker-compose.yml
file: ../docker-compose.yml
service: fuseki
fuseki-cache:
extends:
file: ../dockerfiles/docker-compose.yml
file: ../docker-compose.yml
service: fuseki-cache
skosmos:
extends:
file: ../dockerfiles/docker-compose.yml
file: ../docker-compose.yml
service: skosmos
volumes:
- type: bind
Expand Down

0 comments on commit 906b920

Please sign in to comment.