Skip to content

Commit

Permalink
Merge pull request #2002 from didoda/fix/v4/docker-entrypoint
Browse files Browse the repository at this point in the history
Fix docker perms for sqlite db and folder
  • Loading branch information
batopa committed Apr 14, 2023
2 parents 8a88ecc + b1e9520 commit f0b3201
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions docker-entrypoint.sh
Expand Up @@ -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
Expand Down

0 comments on commit f0b3201

Please sign in to comment.