first commit
This commit is contained in:
61
docker-entrypoint.sh
Normal file
61
docker-entrypoint.sh
Normal file
@@ -0,0 +1,61 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
mkdir -p /app/cve_db /app/logs
|
||||
chmod -R 777 /app/cve_db /app/logs
|
||||
|
||||
WORKERS=${WORKERS:-4}
|
||||
WORKER_TIMEOUT=${WORKER_TIMEOUT:-120}
|
||||
PORT=${PORT:-5000}
|
||||
|
||||
echo "======================================"
|
||||
echo "CVE Monitor Docker Container"
|
||||
echo "======================================"
|
||||
|
||||
case "$1" in
|
||||
app)
|
||||
echo "Starting Flask app with Gunicorn..."
|
||||
echo " Workers: $WORKERS"
|
||||
echo " Timeout: $WORKER_TIMEOUT"
|
||||
echo " Port: $PORT"
|
||||
echo "======================================"
|
||||
exec gunicorn \
|
||||
--bind 0.0.0.0:$PORT \
|
||||
--workers $WORKERS \
|
||||
--timeout $WORKER_TIMEOUT \
|
||||
--access-logfile - \
|
||||
--error-logfile - \
|
||||
--log-level info \
|
||||
app:app
|
||||
;;
|
||||
|
||||
scheduler)
|
||||
echo "Starting CVE Scheduler..."
|
||||
echo "======================================"
|
||||
exec python scheduler.py
|
||||
;;
|
||||
|
||||
discord)
|
||||
echo "Starting Discord Bot..."
|
||||
echo "======================================"
|
||||
exec python discord_bot.py
|
||||
;;
|
||||
|
||||
update)
|
||||
echo "Running manual CVE update..."
|
||||
echo "======================================"
|
||||
exec python -c "from cve_handler import update_all_vendors; update_all_vendors(force=True)"
|
||||
;;
|
||||
|
||||
shell)
|
||||
echo "Starting interactive shell..."
|
||||
echo "======================================"
|
||||
exec /bin/sh
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Executing custom command: $@"
|
||||
echo "======================================"
|
||||
exec "$@"
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user