Browse Source

Updating instructions to run labkey as non-root user

Andrej Studen 1 week ago
parent
commit
1be2bd2bf2
2 changed files with 16 additions and 2 deletions
  1. 12 1
      README.md
  2. 4 1
      config/web/Dockerfile

+ 12 - 1
README.md

@@ -28,7 +28,18 @@ git pull origin master
 - copy `bin/env.sh.sample` to `bin/env.sh` and set a secret `$PGPASS`, other settings are probably OK, 
   check `$DOCKERCOMPOSE`
 - set the same value as `password` in `labkey/labkey.xml` 
-  
+
+### Permissions
+
+To run as non-root user labkey, files should have the proper permissions. I believe that starting from scratch, 
+the neccesary files will be created with appropriate permissions. If using an old implementation or in case of troubles, the following directories should be owned by labkey:labkey on host machine:
+
+```bash
+~/software/src/LabKey22.3.2-3-community/*
+~/labkey/externalModules
+~/labkey/files
+```
+
 ### Start containers
   
 Run `bin/startLabkey.sh`. This will do several things:

+ 4 - 1
config/web/Dockerfile

@@ -26,6 +26,9 @@ RUN sudo apt-get update && sudo apt-get install -y \
 	&& sudo apt-get install -y r-base \
 	&& sudo rm -rf /var/lib/apt/lists/*
 
-USER root
+RUN sudo mkdir /usr/local/labkey \
+   && sudo chown -R labkey:labkey /usr/local/tomcat \
+   && sudo chown -R labkey:labkey /usr/local/labkey
+#USER root
 
 LABEL "name"="tomcatR"