Browse Source

Dockerfile: Define data volume and entryscript

The entryscript is needed to set correct permissions on the data
directory.
Felix Breidenstein 8 năm trước cách đây
mục cha
commit
8c19e869b7
2 tập tin đã thay đổi với 13 bổ sung0 xóa
  1. 8 0
      Dockerfile
  2. 5 0
      docker/entrypoint.sh

+ 8 - 0
Dockerfile

@@ -13,4 +13,12 @@ RUN apt-get update && apt-get install -y \
     # We enable Apache's mod_rewrite
     a2enmod rewrite
 
+
+# Copy app content
 COPY . /var/www/html
+
+# Copy start script
+COPY docker/entrypoint.sh /
+VOLUME /var/www/html/data
+
+CMD /entrypoint.sh

+ 5 - 0
docker/entrypoint.sh

@@ -0,0 +1,5 @@
+#! /bin/sh
+
+chown -R www-data /var/www/html/data
+rm -r /var/www/html/docker
+apache2-foreground