-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
executable file
·41 lines (34 loc) · 1.4 KB
/
docker-entrypoint.sh
File metadata and controls
executable file
·41 lines (34 loc) · 1.4 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
set -e
echo "============================================="
echo "Paper2Poster Docker Container Starting..."
echo "============================================="
# Check if we should skip model download
if [ "${SKIP_MODEL_DOWNLOAD}" = "true" ]; then
echo "Skipping model download (SKIP_MODEL_DOWNLOAD=true)"
else
# Check if models are already downloaded
MODEL_MARKER_FILE="/app/model_cache/.models_downloaded"
if [ -f "$MODEL_MARKER_FILE" ]; then
echo "Models already downloaded (found marker file)"
else
echo "Downloading models for the first time..."
echo "This may take 10-30 minutes depending on your internet speed..."
# Run the model download script
python /app/download_models.py
# Create marker file to indicate models have been downloaded
if [ $? -eq 0 ]; then
touch "$MODEL_MARKER_FILE"
echo "Model download completed successfully!"
else
echo "Model download failed! The service may not work properly."
# Continue anyway - models might download on first request
fi
fi
fi
echo "============================================="
echo "Starting Paper2Poster API Service..."
echo "============================================="
# Execute the command passed to the container
# Default is to start the API service with the startup script
exec "$@"