- Remove unnecessary files in container

This commit is contained in:
nwithan8 2023-12-09 01:10:26 -07:00
parent f9fdc7f640
commit ab89644f9b
2 changed files with 4 additions and 3 deletions

View File

@ -26,7 +26,8 @@ COPY . .
# Delete unnecessary files in WORKDIR (/app) folder (not caught by .dockerignore) # Delete unnecessary files in WORKDIR (/app) folder (not caught by .dockerignore)
RUN echo "**** removing unneeded files ****" RUN echo "**** removing unneeded files ****"
RUN rm -rf /requirements.txt # Remove all files except .py files and entrypoint.sh (keep all directories)
RUN find / -type f -maxdepth 1 ! -name '*.py' ! -name 'entrypoint.sh' -delete
# Run entrypoint.sh script # Run entrypoint.sh script
ENTRYPOINT ["sh", "/entrypoint.sh"] ENTRYPOINT ["sh", "/entrypoint.sh"]

View File

@ -4,7 +4,7 @@
mkdir -p /etc/cron.d mkdir -p /etc/cron.d
# Read cron schedule from environment variable # Read cron schedule from environment variable
CRON_SCHEDULE=${CRON_SCHEDULE:-"0 0 * * *"} # Default to midnight every day if not supplied CRON_SCHEDULE=${CRON_SCHEDULE:-"* * * * *"} # Default to midnight every day if not supplied
echo "Cron schedule: $CRON_SCHEDULE" echo "Cron schedule: $CRON_SCHEDULE"
@ -15,7 +15,7 @@ else
DRY_RUN_FLAG="" DRY_RUN_FLAG=""
fi fi
# DRY_RUN_FLAG="--dry-run" DRY_RUN_FLAG="--dry-run"
echo "Dry run flag: $DRY_RUN_FLAG" echo "Dry run flag: $DRY_RUN_FLAG"