File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,10 @@ services:
9393 volumes :
9494 # Keep Solr data directory between reboots
9595 - solr_data:/var/solr/data
96- # Initialize all DSpace Solr cores using the mounted configsets (see above), then start Solr
96+ # NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
97+ # /var/solr/data directory. Then we start Solr as the "solr" user.
98+ user : root
99+ # Initialize all DSpace Solr cores, then start Solr
97100 entrypoint :
98101 - /bin/bash
99102 - ' -c'
@@ -111,7 +114,8 @@ services:
111114 cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
112115 precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
113116 cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
114- exec solr -f
117+ chown -R solr:solr /var/solr
118+ runuser -u solr -- solr-foreground
115119volumes :
116120 assetstore :
117121 pgdata :
Original file line number Diff line number Diff line change @@ -97,11 +97,16 @@ services:
9797 volumes :
9898 # Keep Solr data directory between reboots
9999 - solr_data:/var/solr/data
100+ # NOTE: We are not running Solr as "root", but we need root permissions to copy our cores to the mounted
101+ # /var/solr/data directory. Then we start Solr as the "solr" user.
102+ user : root
100103 # Initialize all DSpace Solr cores using the mounted local configsets (see above), then start Solr
101104 # * First, run precreate-core to create the core (if it doesn't yet exist). If exists already, this is a no-op
102105 # * Second, copy configsets to this core:
103106 # Updates to Solr configs require the container to be rebuilt/restarted:
104107 # `docker compose -p d7 -f docker/docker-compose.yml -f docker/docker-compose-rest.yml up -d --build dspacesolr`
108+ # * Third, ensure all new folders are owned by "solr" user
109+ # * Finally, start Solr as the "solr" user via the provided solr-foreground script
105110 entrypoint :
106111 - /bin/bash
107112 - ' -c'
@@ -119,7 +124,8 @@ services:
119124 cp -r /opt/solr/server/solr/configsets/qaevent/* qaevent
120125 precreate-core suggestion /opt/solr/server/solr/configsets/suggestion
121126 cp -r /opt/solr/server/solr/configsets/suggestion/* suggestion
122- exec solr -f
127+ chown -R solr:solr /var/solr
128+ runuser -u solr -- solr-foreground
123129volumes :
124130 assetstore :
125131 pgdata :
You can’t perform that action at this time.
0 commit comments