(1) Install ddev
(2) Clone this repository
git clone https://github.com/qubeshub/hubzero-docker.git ./qubeshub
cd qubeshub
(3) Install CMS
git clone https://github.com/qubeshub/hubzero-cms.git ./public
cp -r app/config public/app/config
ddev config --php-version=8.2 --database=mariadb:10.11
ddev start
ddev import-db --file=data/databasedump.sql --database=example
(4) Run setup scripts
ddev ssh
cd public/core
php bin/composer install
php bin/muse migration -f
exit
(5) Launch the site!
ddev launch
All code, static files, and databases should persist across (1) ddev restart
, (2) ddev stop
then ddev start
, or even (3) ddev delete
then ddev start
(assuming you don't include --omit-snapshot
with ddev delete
, which will destroy the databases as well). Note, however, that Solr data will be deleted, so you will have to rebuild indexes. In the admin interface, go to Components -> Search
, choose Searchable Components
, and rebuild the desired indexes (in particular, make sure to rebuild Publications
for resource search & browse).
The following lists the additional configuration settings with their explanations.
.ddev/config.yaml
docroot: public
webserver_type: nginx-fpm
upload_dirs
:app/site
and../data/example
(So Mutagen doesn't sync these files - they will instead be mounted in Docker images). Note that the paths are relative todocroot
.hooks
: Launch Solrweb_extra_exposed_ports
: Access to Solr Admin at http://{project name}.ddev.site:8445
nginx_full/nginx-site.conf
: Redirect /administrator and /api to /index.php. Also turns off fastcgi buffering to avoid excessive PHP warnings.mysql/sql-mode.cnf
: Make sure mysql strict mode isn't set so migrations can run (presumably can be removed after migration to reinstate strict mode)web-build/Dockerfile
: Install hubzero-solr packagedocker-compose.mounts.yaml
: Mountdata/example
directory to/srv/example
inside the container. This is used for project files and will ensure persistence across ddev status updates (such asddev restart
,ddev stop
, and evenddev destroy
).
The command ddev logs
is very helpful and will show you PHP and database logs. If you want realtime log updates, include the -f
flag. The following command shows realtime log updates and color codes warning ([warn]
) and error ([error]
) messages, filtering out all other message types, such as information-only ([info]
):
ddev logs -f | stdbuf -oL grep -iE '\[warn\]|\[error\]' | stdbuf -oL perl -pe '
s/\[warn\]/\e[33m[warn]\e[0m/i;
s/\[error\]/\e[31m[error]\e[0m/i;
'
Or, use the following if you want a bash function (e.g., include in your .bashrc
file):
ddev_logs() {
ddev logs -f | stdbuf -oL grep -iE '\[warn\]|\[error\]' | stdbuf -oL perl -pe '
s/\[warn\]/\e[33m[warn]\e[0m/i;
s/\[error\]/\e[31m[error]\e[0m/i;
'
}
Solr configuration in admin Search settings:
- Solr Host:
localhost
- Solr Port:
8445
- Solr Core:
hubzero-solr-core
- Solr Context:
solr
- Solr Path:
/
- Solr Log Path:
/srv/hubzero-solr/logs/solr.log
When attempting to access Solr Admin, you may receive an Error 431: Request Header Fields Too Large. Here are the steps to fix this:
ddev ssh
sudo vi /etc/default/hubzero-solr.in.sh
- Add
SOLR_OPTS="$SOLR_OPTS -Dsolr.jetty.request.header.size=65535"
and save the file. sudo /etc/init.d/hubzero-solr restart
TBD