From 7c23c33db75d0faf749555639f7dc2615a86be89 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Fabbri?= <andre.fabbri@ipsp.cnr.it>
Date: Mon, 28 Aug 2023 11:18:08 +0200
Subject: [PATCH 1/2]    Fix compose

    - For mongo service, change the "sleep 3" instruction into "mongostat -n 1".
    The instruction meant to wait for the server startup procedure.
    Mongostat should print up when such procedure are completed meanwhile "sleep"
    is infrastucture dependent
    - For opensilex service, reply the "chown" command at the entry point time.
    The mounted volume remaind owned by root:root otherwise and the config file
    could not be generated.
---
 docker-compose.yml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index d663908..7e7fea9 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -26,7 +26,7 @@ services:
     command: >
       bash -c "
       (
-        sleep 3 &&
+        mongostat -n=1  &&
         mongo --eval \"rs.initiate({'_id':'opensilex','members':[{'_id':0,'host':'opensilex-docker-mongodb:27017'}]})\" &&
         wait
       ) & docker-entrypoint.sh --replSet opensilex
@@ -77,6 +77,7 @@ services:
       - "$OPENSILEX_LOCAL_FILE_SYSTEM_DIRECTORY:$INTERNAL_DATA_DIRECTORY"
     command: >
       bash -c "
+        sudo chown -R opensilex:opensilex /home/opensilex/config &&
         rm -f /home/opensilex/config/opensilex.yml &&
         rm -f /home/opensilex/config/opensilex-template-custom.yml &&
         cat  /home/opensilex/config/opensilex-template.yml >> /home/opensilex/config/opensilex-template-custom.yml &&
-- 
GitLab


From 9a3e9358c434bce688380bcdb6488dc04568d7b8 Mon Sep 17 00:00:00 2001
From: Arnaud Charleroy <arnaud.charleroy@inrae.fr>
Date: Mon, 4 Mar 2024 23:06:02 +0100
Subject: [PATCH 2/2] Add pull request

---
 docker-compose.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/docker-compose.yml b/docker-compose.yml
index 7e7fea9..9cacacd 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -77,7 +77,6 @@ services:
       - "$OPENSILEX_LOCAL_FILE_SYSTEM_DIRECTORY:$INTERNAL_DATA_DIRECTORY"
     command: >
       bash -c "
-        sudo chown -R opensilex:opensilex /home/opensilex/config &&
         rm -f /home/opensilex/config/opensilex.yml &&
         rm -f /home/opensilex/config/opensilex-template-custom.yml &&
         cat  /home/opensilex/config/opensilex-template.yml >> /home/opensilex/config/opensilex-template-custom.yml &&
-- 
GitLab