-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6f11be
commit 1b276fb
Showing
6 changed files
with
129 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ cache/ | |
.env | ||
config.json | ||
|
||
docker/data | ||
!docker/.env | ||
|
||
.DS_Store | ||
node_modules | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Environment variables can also be set here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
FROM node:20-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Copy and install dependencies | ||
COPY package*.json ./ | ||
RUN npm ci --omit=dev | ||
|
||
# Bundle app source | ||
COPY . . | ||
|
||
RUN mkdir /config | ||
|
||
# Use pm2 to run app | ||
RUN npm i -g pm2 | ||
|
||
# Symlink config file | ||
RUN rm config.json | ||
RUN ln -s /config/config.json ./config.json | ||
|
||
CMD pm2-runtime server.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# [Wikidata JSKOS](https://github.com/gbv/wikidata-jskos) (Docker) | ||
|
||
Wikidata JSKOS implements a web service to access [Wikidata] in [JSKOS] format. The data includes Wikidata items as concepts and concept schemes (read) and mappings between Wikidata and other authority files (read and write). It is part of a larger infrastructure of [Project coli-conc](https://coli-conc.gbv.de). | ||
|
||
- See [GitHub](https://github.com/gbv/wikidata-jskos) for more information about the tool. | ||
|
||
## Supported Architectures | ||
Currently, only `x86-64` is supported. | ||
|
||
## Available Tags | ||
- The current release version is available under `latest`. However, new major versions might break compatibility of the previously used config file, therefore it is recommended to use a version tag instead. | ||
- We follow SemVer for versioning the application. Therefore, `x` offers the latest image for the major version x, `x.y` offers the latest image for the minor version x.y, and `x.y.z` offers the image for a specific patch version x.y.z. | ||
- Additionally, the latest development version is available under `dev`. | ||
|
||
## Usage | ||
It is recommended to run the image using [Docker Compose](https://docs.docker.com/compose/). Note that depending on your system, it might be necessary to use `sudo docker compose`. For older Docker versions, use `docker-compose` instead of `docker compose`. | ||
|
||
1. Create `docker-compose.yml`: | ||
|
||
```yml | ||
version: "3" | ||
|
||
services: | ||
wikidata-jskos: | ||
image: ghcr.io/gbv/wikidata-jskos | ||
# Can be configured via a JSON file mounted into `/config/config.json`... | ||
volumes: | ||
- ./data/config:/config | ||
# ... or via environment variables | ||
environment: | ||
- NODE_ENV=production | ||
- PORT=2013 | ||
ports: | ||
- 2013:2013 | ||
restart: unless-stopped | ||
``` | ||
2. Create data folders: | ||
```bash | ||
mkdir -p ./data/config | ||
echo "{}" > ./data/config/config.json | ||
``` | ||
|
||
3. Start the application: | ||
|
||
```bash | ||
docker compose up -d | ||
``` | ||
|
||
This will create and start a wikidata-jskos container running under host (and guest) port 2013. See [Configuration](#configuration) on how to configure it. | ||
|
||
You can now access the application under `http://localhost:2013`. | ||
|
||
## Application Setup | ||
Note: After adjusting any configurations, it is required to restart or recreate the container: | ||
- After changing configuration files, restart the container: `docker compose restart` | ||
- After changing `docker-compose.yml` (e.g. adjusting environment variables), recreate the container: `docker compose up -d` | ||
|
||
### Configuration | ||
The folder `/config` (mounted as `./data/config` if configured as above) contains the configuration file `config.json` where wikidata-jskos is configured. You can also use environment variables via `environment` or `env_file` to configure wikidata-jskos. Please refer to the [main documentation](../README.md#configuration) for more information and all available options. | ||
|
||
[Wikidata]: https://www.wikidata.org/ | ||
[JSKOS]: https://gbv.github.io/jskos/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: "3" | ||
|
||
services: | ||
wikidata-jskos: | ||
build: | ||
context: .. | ||
dockerfile: docker/Dockerfile | ||
volumes: | ||
- ./data/config:/config | ||
environment: | ||
- NODE_ENV=production | ||
- AUTH_ALGORITHM=RS256 | ||
# Example how to set AUTH_KEY (it is recommend to use env_file or config.json instead though) | ||
- |- | ||
AUTH_KEY_=-----BEGIN PUBLIC KEY----- | ||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjmpVmMlsiVyihtYc/lwS | ||
pxZpyCXcMmdNH8nLHWFbmTvzcBXA7R5uvdH3mZMqF2Cap+VmPmnqXj0A9dLgrDuq | ||
xC4UK049xqcNnuM7Kz7BDJ91KflFN3JBdqW4V7CDTXz4tArzCzrSgOhGACsv3kti | ||
gvi3UEnb74eajS2ZZxHuoXBfvUdBi10RaxEajbbHTl9yGbdcGpLwPo/wum6hCpEv | ||
5yfPx48Sf8T8hgBWccAOljorkKOTNS54Qf9hFH4rGPhnfjjYHz+G3xH6WlNcqIkO | ||
mUd+qsCLVCtxTVh3na0gn2skWDpXwph/o8ftO+/05wykkaodza74P9mvalhk3Vzb | ||
xQIDAQAB | ||
-----END PUBLIC KEY----- | ||
env_file: | ||
- .env | ||
ports: | ||
- 2013:2013 | ||
restart: unless-stopped |