dockerize!

This commit is contained in:
Matteo Rosati
2026-01-14 23:54:51 +01:00
parent 1e76403565
commit 46ddcc16da
14 changed files with 1362 additions and 18 deletions

36
entrypoint-schedule.sh Normal file
View File

@@ -0,0 +1,36 @@
#!/bin/sh
set -e
# Validate required environment variables
if [ -z "$ENDPOINT_URL" ]; then
echo "Error: ENDPOINT_URL environment variable is required but not set"
exit 1
fi
if [ -z "$MONGO_URI" ]; then
echo "Error: MONGO_URI environment variable is required but not set"
exit 1
fi
if [ -z "$DB_NAME" ]; then
echo "Error: DB_NAME environment variable is required but not set"
exit 1
fi
if [ -z "$COLLECTION_NAME" ]; then
echo "Error: COLLECTION_NAME environment variable is required but not set"
exit 1
fi
# Display configuration (without sensitive data)
echo "Starting schedule script with configuration:"
echo " ENDPOINT_URL: ${ENDPOINT_URL}"
echo " MONGO_URI: [REDACTED]"
echo " DB_NAME: ${DB_NAME}"
echo " COLLECTION_NAME: ${COLLECTION_NAME}"
echo ""
# Run the schedule script
# Using exec to replace the shell process with the Python process
# This ensures proper signal handling (SIGTERM, SIGINT) and exit code propagation
exec python schedule.py