23 lines
533 B
Bash
23 lines
533 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
echo "=== Puzzle Generator Container Starting ==="
|
|
echo "Time: $(date)"
|
|
echo "Output directory: ${OUT_DIR}"
|
|
echo "Puzzles per day: ${PUZZLES_PER_DAY}"
|
|
echo ""
|
|
|
|
# Ensure output directory exists
|
|
mkdir -p "${OUT_DIR}"
|
|
|
|
# Generate initial puzzle on startup (optional)
|
|
if [ "${GENERATE_ON_START}" = "true" ]; then
|
|
echo "Generating initial puzzles..."
|
|
java -cp /app/target puzzle.DailyGenerator
|
|
echo ""
|
|
fi
|
|
|
|
# Start cron scheduler
|
|
echo "Starting cron scheduler..."
|
|
exec /usr/local/bin/supercronic /app/crontab
|