dockerize!
This commit is contained in:
36
entrypoint-schedule.sh
Normal file
36
entrypoint-schedule.sh
Normal 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
|
||||
Reference in New Issue
Block a user