Skip to content

Commit 185aefd

Browse files
fix: Improved docker cron entrypoint
1 parent 6fd4063 commit 185aefd

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

docker/php-fpm-alpine/docker-cron-entrypoint

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ set -e
33

44
env >> /etc/environment
55

6-
# Need to fix permissions for be able to create cache dir
7-
/bin/chown -R www-data:www-data /var/www/html/var || true;
8-
/bin/mkdir -p /var/www/html/var/cache || true;
9-
# Need to fix permissions for be able to write in cache dir
106
/bin/chown -R www-data:www-data /var/www/html/var || true;
7+
/bin/chown -R www-data:www-data /var/www/html/config || true;
8+
9+
# Print local env vars to .env.xxx.php file for performances and crontab jobs
10+
/usr/bin/sudo -u www-data -- bash -c "/usr/local/bin/composer dump-env prod"
11+
# To improve performance (i.e. avoid decrypting secrets at runtime),
12+
# you can decrypt your secrets during deployment to the "local" vault:
13+
/usr/bin/sudo -u www-data -- bash -c "APP_RUNTIME_ENV=prod /var/www/html/bin/console secrets:decrypt-to-local --force"
1114

1215
# Let cron take the wheel
1316
echo "Starting cron in foreground."

0 commit comments

Comments
 (0)