docker-cron icon indicating copy to clipboard operation
docker-cron copied to clipboard

while this is fine but the environment variable declated in the docker file will not be picked up by cron

Open sanfx opened this issue 3 years ago • 0 comments

I disovered even if you have environement variable defined in the dockerfile or in the docker stack file , the environment variable will be available to shell if container but not to the cron. for that you would need to define env variable inside the cron file.

MYSQL_PASSWORD=secret_password
PYTHONPATH=/usr/local/app

*/45 * * * * python3 app.py >> /var/log/cron.log 2>&1
# An empty line is required at the end of this file for a valid cron file.

sanfx avatar Oct 02 '21 18:10 sanfx