-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·42 lines (33 loc) · 1.48 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·42 lines (33 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# PixIntelligence Docker Entrypoint Script
set -e
echo "╔══════════════════════════════════════════════════════════════╗"
echo "║ PixIntelligence Docker Container ║"
echo "╚══════════════════════════════════════════════════════════════╝"
echo ""
# Initialize database if it doesn't exist
if [ ! -f "/app/src/data/pixintelligence.db" ]; then
echo "📦 Initializing database..."
python -c "from src.web.database import init_db; init_db()"
echo "✓ Database initialized"
fi
# Create necessary directories
echo "📁 Ensuring required directories exist..."
mkdir -p /app/src/data/uploads
mkdir -p /app/src/data/camera_fingerprints
mkdir -p /app/output
mkdir -p /app/logs
# Check if camera fingerprints exist
if [ ! -f "/app/src/data/camera_fingerprints/camera_fingerprints.h5" ]; then
echo "⚠ Warning: Camera fingerprints database not found"
echo " PRNU analysis will be limited"
fi
# Run any migrations or setup scripts here
# python -m src.web.database migrate
echo ""
echo "🚀 Starting PixIntelligence..."
echo " Web UI: http://0.0.0.0:${PIXINTELLIGENCE_PORT:-8000}/ui"
echo " API: http://0.0.0.0:${PIXINTELLIGENCE_PORT:-8000}/docs"
echo ""
# Execute the main command
exec "$@"