From 8c19e869b75fce4d905c76d4d588fbf3cd64623b Mon Sep 17 00:00:00 2001 From: Felix Breidenstein Date: Tue, 20 Feb 2018 12:12:32 +0100 Subject: [PATCH] Dockerfile: Define data volume and entryscript The entryscript is needed to set correct permissions on the data directory. --- Dockerfile | 8 ++++++++ docker/entrypoint.sh | 5 +++++ 2 files changed, 13 insertions(+) create mode 100755 docker/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 6e7e1686..c7d45baf 100644 --- a/Dockerfile +++ b/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 diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh new file mode 100755 index 00000000..6d2df637 --- /dev/null +++ b/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