diff --git a/Dockerfile b/Dockerfile index 96620f7e6e..fc7e1f91e8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ COPY docker-entrypoint.sh /usr/local/bin/ COPY . /var/www/html WORKDIR /var/www/html RUN chown -R www-data:www-data /var/www/html +RUN chmod g+w /var/www/html USER www-data:www-data VOLUME /var/www/html/webroot/_files diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 2cd13d11a0..14b6b8f118 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -24,6 +24,9 @@ if [ ! -z "${DATABASE_URL}" ]; then DATABASE_PATH=$(php -r "echo substr(parse_url(preg_replace('/^([\\w\\\\\\]+)/', 'file', getenv('DATABASE_URL')), PHP_URL_PATH), 1);") echo "=====> Path: ${DATABASE_PATH}" chmod a+rwx ${DATABASE_PATH} + DATABASE_DIR="$(dirname ${DATABASE_PATH})" + chown www-data:www-data ${DATABASE_PATH} ${DATABASE_DIR} + chmod g+w ${DATABASE_DIR} fi bin/cake cache clearAll