浏览代码

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 年之前
父节点
当前提交
3da0b960d8
共有 2 个文件被更改,包括 18 次插入4 次删除
  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