-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathrun_docker.sh
More file actions
executable file
·29 lines (22 loc) · 813 Bytes
/
run_docker.sh
File metadata and controls
executable file
·29 lines (22 loc) · 813 Bytes
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
#!/bin/bash
# Run the PredAI Docker container locally for testing
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOTFS_DIR="$SCRIPT_DIR/predai/rootfs"
# Create a temporary config directory with test configuration
TEMP_CONFIG=$(mktemp -d)
echo "Using temporary config directory: $TEMP_CONFIG"
# Copy predai.py and test config to temp directory
cp "$ROOTFS_DIR/predai.py" "$TEMP_CONFIG/"
cp "$ROOTFS_DIR/predai.yaml" "$TEMP_CONFIG/" 2>/dev/null || echo "sensors: []" > "$TEMP_CONFIG/predai.yaml"
echo ""
echo "Running Docker container with /config mapped to $TEMP_CONFIG"
echo "Press Ctrl+C to stop"
echo ""
# Run the container with config mapped
docker run --rm -it \
-v "$TEMP_CONFIG:/config" \
-e SUPERVISOR_TOKEN="test-token" \
predai:latest
# Cleanup
rm -rf "$TEMP_CONFIG"