Ginger includes a site skeleton that should be used when a new site is created. To do so, run from the Ginger directory:
$ make addsite name=bli_bla_name_of_the_new_site
By default, the latest 0.x
Zotonic version is used. If you wish to do
development work on Zotonic files:
-
Clone Zotonic into a directory one level above Ginger:
$ pwd /bli/bla/ginger $ cd .. $ git clone https://github.com/zotonic/zotonic.git
-
Start the containers loading your Zotonic volume:
$ make up-zotonic
This will compile Zotonic so it starts properly even after changing Zotonic branches or versions.
If you wish to point to a Zotonic clone in another directory, override the
ZOTONIC
environment variable:$ ZOTONIC=/some/other/zotonic/dir make up-zotonic
-
To run the Zotonic tests:
$ docker-compose -f docker-compose.yml -f docker-compose.zotonic.yml run zotonic test
Connect to PostgreSQL:
docker-compose exec postgres psql -U zotonic
-
Copy the database dump
.sql
file to thedata/
directory. -
Then run:
$ make import-db-file site=site-name file=site-dump.sql
-
If there are no backups yet, create a backup on the remote Zotonic site.
-
Then run:
$ make import-db-backup host=ginger01.driebit.net site=site-name
Substitute ginger-test.driebit.net
or ginger-acceptatie.driebit.net
for
ginger01.driebit.net
depending on the environment that you want to import
the latest backup from.
The Ginger Docker setup includes an Elasticsearch container. You can use Kibana
for querying Elasticsearch. Kibana is available at http://localhost:5601
.
Click on ‘Dev Tools’ to open up a console where you can enter Elasticsearch
queries.
This is a known issue in Zotonic: zotonic/zotonic#1321.
zotonic_1 | 09:58:40.559 [error] Zotonic start error: {not_running,filezcache}
zotonic_1 | erl_call: failed to connect to node zotonic001@3aa4f137ecdc
zotonic_1 | Zotonic is not running. You need to start Zotonic first to use this command.
Solution:
$ rm -rf ../zotonic/priv/mnesia/*
The make up
command already does this for you.
Inotify is not picking up changes.
Solutions:
-
If you’re using IntelliJ (PHPStorm, WebStorm), disable ‘Use “safe write”’ in IntelliJ’s preferences.
-
If that doesn’t work, restart Docker.
-
If that doesn’t work, click the Docker icon, Preferences, Uninstall/Reset and finally the ‘Reset’ button.
This seems to be related to osxfs.
Solution:
Install Docker for Mac beta instead of stable, which includes some fixes for osxfs.
On starting the docker container you get an error similar to this one
ERROR: for postgres Unknown runtime specified default
ERROR: Encountered errors while bringing up the project.
Solution:
$ docker-compose down -v
This is possibly related to zotonic/zotonic#1490.
Solution:
In Docker Preferences, on the Advanced tab, change to 2 CPUs and restart Docker.