Docker-compose yaml file for CQPweb, starting from the dockerfile by egon w. stemle from UniBozen (Sud Tirol, Europe).
From CQPweb's site:
CQPweb is a web-based graphical user interface (GUI) for some elements of the CWB - and in particular, the CQP query processor. Thus the name.
CQPweb is designed to replicate the user-interface of the popular BNCweb tool, which also uses CQP as a back-end. Like BNCweb, CQPweb uses a database alongside the CWB to provide extra functions beyond those built into CWB/CQP. However, unlike BNCweb, CQPweb can be used with any corpus.
CQPweb is especially suitable for students, non-linguists, and others for whom a Unix-like command-line is a terrifying prospect.
- separate containers for MariaDB (sql) and CQPweb (cqpweb) sub-systems
- automatic building of CWB tools (latest version)
- (quasi)automatic installation of CQPweb GUI (latest version)
- basic installation of R (based on R Docker image)
- MariaDB's latest version (straight from the original Docker image)
- persistent volumes
- Edit .env.edit and secrets.env.edit to fit your needs (see below for details). Rename the former to .env and the latter to secrets.env
docker-compose build
docker-compose up
- When the system pops up "Ok, now you should run /var/www/html/CQPweb/bin/autosetup.php in order to finish the autosetup", run
docker-compose exec cqpweb bash
to enter CQPweb container terminal cd /var/www/html/CQPweb/bin/
and run autosetup.php- Visit http://youraddress:8080/CQPweb
- Drop your VRT files to ./${FIRSTNAME}-container/cqpweb/upload
- Happy corpus linguistics!
Next time(s) you will just have to run docker-compose up -d
Before starting, you have to modify two files: .env and secrets.env
This file is read by docker-compose: you first need to set up your domain (${DOMAINNAME}) and host name (${FIRSTNAME}). The latter is particularly important, since persistent volumes on the host filesystem are created using this name (see persistent volumes). The ${CORPORA} variable defaults to /var/corpora
, while the ${REGISTRY} variable to /usr/local/share/cwb/registry
. Please make sure that these directories exist!
This file is read by containers. You can safely ignore the Apache environment variables; just modify MySQL variables and LOCALTIME.
This is the main docker-compose file. No changes to this file should be necessary, unless you want to modify the HTTP port, which is set to 8080, or modify the location of permanent volumes.
In order to mantain corpora data and registry, CQPweb files and SQL database through further code upgrades, the following persistent volumes are provided:
Host | Container:directory | Description & Usage |
---|---|---|
${CORPORA} | cqpweb:/var/corpora | corpora data |
${REGISTRY} | cqpweb:/usr/local/share/cwb/registry | corpora registry files |
./${FIRSTNAME}-container/cqpweb/data | cqpweb:/var/www/html/CQPweb | CQPweb data files |
./${FIRSTNAME}-container/cqpweb/upload | cqpweb:/var/cqpweb/upload | CQPweb upload directory |
./${FIRSTNAME}-container/cqpweb/tmp | cqpweb:/var/cqpweb/tmp | CQPweb temporary directory |
./${FIRSTNAME}-container/sql/data | sql:/var/lib/mysql | MariaDB data |
Of course, sometimes you will need the command line, maybe for preparing your corpora with CWB tools, playing with CQP in text mode or to run some PHP scripts to optimise your CQPweb installation. To fire up a bash shell inside CQPweb, run from the Docker directory:
docker-compose exec cqpweb bash