Ver código fonte

Move permission handling to entrypoint script

This change is needed to allow the use of bind mounts as they would not
be affected if permissions are set in Dockerfile.
wernerfred 4 anos atrás
pai
commit
3da0b960d8
2 arquivos alterados com 18 adições e 4 exclusões
  1. 9 4
      Dockerfile
  2. 9 0
      entrypoint.sh

+ 9 - 4
Dockerfile

@@ -28,8 +28,13 @@ RUN cd /tmp \
 
 RUN mkdir ${APACHE_DOCUMENT_ROOT} \
     && unzip -q /tmp/rainloop-community-1.14.0.zip -d ${APACHE_DOCUMENT_ROOT} \
-    && find /rainloop -type d -exec chmod 755 {} \; \
-    && find /rainloop -type f -exec chmod 644 {} \; \
-    && chown -R www-data:www-data /rainloop
+    && apt purge -q -y unzip wget gpg \
+    && rm -rf /tmp/*
 
-EXPOSE 80
+COPY entrypoint.sh /entrypoint.sh
+
+RUN chmod +x /entrypoint.sh
+
+EXPOSE 80
+
+ENTRYPOINT ["/entrypoint.sh"]

+ 9 - 0
entrypoint.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Set rainloop directory permissions to catch bind mounts too
+chown -R www-data:www-data /rainloop/data
+find /rainloop -type d -exec chmod 755 {} \;
+find /rainloop -type f -exec chmod 644 {} \;
+
+# Call same entrypoint command as base image
+/usr/local/bin/apache2-foreground