Hi Tim,
excuse me, you are completely right, my question was very short.
Referring to the link to docker I’m looking for the oppsite way. I want to set my environment-variables in docker-compose.yml completly. This works very well in the past by the following config:
tgc-dck-silver4:
image: tgc-silver4
container_name: tgc_silver4
build:
...
volumes:
...
environment:
- SS_DATABASE_SERVER=tgc_database
- SS_DATABASE_NAME=dbxxx
- SS_DATABASE_USERNAME=...
- SS_DATABASE_PASSWORD=...
- ...
networks:
- tgc-dck-revproxy_tgc_network
Everything runs fine until I installed the module silverstripe/silverstripe-fulltextsearch/
. The additional SolR-server runs in a standalone-container and works fine too. I’m able to generate the config via the module-task SolrConfigure and start the Solr-instance loading the resulting cores.
I want to run the next step - the task Solr.Reindex, to generate all index-entries for my pages and dataobjects. This task (running inside my SS4-container as it is part of the fulltextsearch-module) checks the DB::config and breaks with the message
silverstripe\fulltextsearch\solr\tasks\solr_reindex.INFO: Silverstripe Framework requires a "database" key in DB::getConfig(). Did you forget to set SS_DATABASE_NAME or SS_DATABASE_CHOOSE_NAME in your environment? [] []
But i have a DB-configuration in my docker-compose.yml
and the CMS works fine by creating and updating data-objects in the last months.
I got no glue from the silverstripe-doku and tried multiple things I found. My last try was to configure the DB in mysite.yml
twice, using the backtics referencing env-vars perspectivly (without success):
SilverStripe\ORM\DB:
database:
- type: 'MySQLDatabase'
- server: 'tgc_database'
- username: '...'
- password: '...'
- database: 'dbxxx
The only workaround i found yet is the .env
file in my project-root. By doing so I have to repeat my config which i want to avoid. Switching all the config back to the environment-file leads to other effort because my environment-stages currently configured via docker-compose.yml
solely.
Do i miss a simple solution or is it the module silverstripe-fulltextsearch
itself which blocks other ways?