Skip to content

Commit bfdbb48

Browse files
committed
Reduce clutter in Example
1 parent 9a775cc commit bfdbb48

File tree

10 files changed

+314
-287
lines changed

10 files changed

+314
-287
lines changed

example/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.env
2-
.shared
2+
.env.backup*

example/README.md

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,74 @@
1-
# Example docker compose configuration
1+
# Wikibase Suite (WBS) Docker Compose example configuration
22

3-
The example docker compose configuration consists of two files:
3+
An example of connecting and using all the WBS provided Docker Images using Docker compose.
44

5-
* `docker-compose.yml` contains two services: wikibase and mysql
6-
* `docker-compose.extra.yml` contains additional services such as wdqs, wdqs-frontend, elasticsearch and quickstatements
5+
The core of this example are the following files:
76

8-
**We recommend you go through `docker-compose.extra.yml` and remove any unwanted services.**
7+
- `docker-compose.yml` Wikibase, Database (MariaDB), WDQS, WDQS Frontend, Elasticsearch, and QuickStatements
8+
- `template.env` The configuration template
99

10-
**This configuration serves as an example of how the images could be used together and isn't production ready**
10+
**DISCLAIMER: This configuration serves as an example of how the images could be used together but isn't production ready**
1111

12-
## Configure your installation
12+
## ⚙️ Configure
1313

14-
Copy `template.env` to `.env` and replace the passwords and secrets with your own.
14+
The first step to running WBS is review and update the configuration to reflect the needs of your own production environment.
1515

16-
## Running a Wikibase instance
16+
1. Copy `template.env` to `.env`
17+
2. Open `.env` in a text editor and create new passwords and a secret according to the guidance. Also read the notes there and review the other highlighted configuration options.
1718

18-
To run a Wikibase instance on port 80 run the following command:
19+
## 🏃🏽‍♀️ Run
1920

20-
```
21-
docker compose up
22-
```
21+
After completing the configuration steps above, run the following command to start the full Wikibase Suite set of services:
2322

24-
This will start up the services defined in [docker-compose.yml](docker-compose.yml), a Wikibase instance, database and a job runner.
23+
```sh
24+
docker compose up -d --wait
25+
```
2526

26-
## Job runner
27+
Once successfully booted, the front-end services will be available at the following locations:
2728

28-
The example docker-compose.yml sets up a dedicated job runner which restarts itself after every job, to ensure that changes to the configuration are picked up as quickly as possible.
29+
- Wikibase: http://localhost:8880
30+
- WDQS: http://localhost:8834
31+
- QuickStatements: http://localhost:8840
2932

30-
If you run large batches of edits, this job runner may not be able to keep up with edits.
31-
32-
You can speed it up by increasing the `MAX_JOBS` variable to run more jobs between restarts, if you’re okay with configuration changes not taking effect in the job runner immediately.
33-
Alternatively, you can run several job runners in parallel by using the `--scale` option.
33+
Note: QuickStatements will not be able to authorize without configuring both `QS_PUBLIC_SCHEME_HOST_AND_PORT` and `WB_PUBLIC_SCHEME_HOST_AND_PORT` to URLs which are accessible both from within the Docker network and on the host machine running Docker. A reverse-proxy service is used to route subdomain names to the related services ports such that you can access the services simply by a set of designated subdomains. An optional reverse proxy service is included in this example as a means for handling this. This service is optional, and any other reverse proxy service can be used. To use the provided service enable the `nginx-proxy` Docker Compose profile:
3434

3535
```sh
36-
docker compose up --scale wikibase-jobrunner=8
36+
docker compose --profile nginx-proxy up -d --wait
3737
```
3838

39-
## Running additional services
39+
When ran using this provided `nginx-proxy` setup the WBS services can be accessed at the configured host addresses.
4040

41-
The Wikibase bundle comes with some additional services that can be enabled.
41+
If Elasticsearch, WDQS, or QuickStatements are not required they can be removed from the related sections in `docker-compose.yml`.
4242

43-
- wdqs
44-
- wdqs-updater
45-
- wdqs-frontend
46-
- quickstatements
47-
- elasticsearch
43+
## ⚠️ Updating configuration and resetting data
4844

49-
### 1. Run with the extra configuration
45+
The `.env` file is currently only designed for initial setup. To reflect changes in the `.env` file after initially running the services, the services will need to be stopped and the related docker volumes deleted. DISCLAIMER: THIS IS CURRENTLY IRREVERSIBLE AND REMOVES ANY DATA AND CONFIGURATION:
5046

5147
```
52-
docker compose -f docker-compose.yml -f docker-compose.extra.yml up
48+
docker compose down --volumes
5349
```
5450

55-
In the volumes section of the wikibase service in [docker-compose.extra.yml](docker-compose.extra.yml), there is one additional script inside the container that automatically sets up the extensions needed for the additional services.
51+
After this is done the next `docker compose` run will again use the settings in `.env` for initial configuration.
5652

57-
```yml
58-
- ./extra-install.sh:/extra-install.sh
59-
```
53+
## Notes
54+
55+
### Extra install
6056

61-
Looking inside extra-install.sh, you see that it executes two scripts which set up an OAuth consumer for quickstatements and creates indices for Elasticsearch.
57+
Looking inside `extra-install.sh`, you see that it executes two scripts which set up an OAuth consumer for quickstatements and creates indices for Elasticsearch. In the volumes section of the wikibase service in [docker-compose.extra.yml](docker-compose.extra.yml), there is one additional script inside the container that automatically sets up the extensions needed for the additional services:
6258

59+
```yml
60+
- ./extra-install.sh:/extra-install.sh
61+
```
6362
64-
There are also additional environment variables passed into Wikibase to configure the Elasticsearch host and port.
65-
```yml
66-
MW_ELASTIC_HOST: ${MW_ELASTIC_HOST}
67-
MW_ELASTIC_PORT: ${MW_ELASTIC_PORT}
63+
### Job runner
64+
65+
The example `docker-compose.yml` sets up a dedicated job runner which restarts itself after every job, to ensure that changes to the configuration are picked up as quickly as possible.
66+
67+
If you run large batches of edits, this job runner may not be able to keep up with edits.
68+
69+
You can speed it up by increasing the `MAX_JOBS` variable to run more jobs between restarts, if you’re okay with configuration changes not taking effect in the job runner immediately.
70+
Alternatively, you can run several job runners in parallel by using the `--scale` option.
71+
72+
```sh
73+
docker compose up --scale wikibase-jobrunner=8
6874
```

example/docker-compose.extra.yml

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)